<!doctype html>
<html lang="zh" data-hairline="true" class="itcauecng" data-theme="light">

<head>
    <meta charSet="utf-8" />
    <title data-rh="true">支持向量机原理详解(六): 序列最小最优化(SMO)算法(Part I) - 知乎</title>
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1" />
    <meta name="renderer" content="webkit" />
    <meta name="force-rendering" content="webkit" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="google-site-verification" content="FTeR0c8arOPKh8c5DYh_9uu98_zJbaWw53J-Sch9MTg" />
    <meta data-rh="true" name="keywords" content="机器学习,SVM,凸二次规划" />
    <meta data-rh="true" name="description"
        content="在前文 支持向量机原理详解(五): KKT条件(Part II)中，我们推导了非线性SVM对偶问题的KKT条件。在此基础上，本文介绍用于训练SVM的序列最小最优化算法，内容如下：SMO算法的停机条件SMO算法的思路解析求解两个变量…" />
    <meta data-rh="true" property="og:title" content="支持向量机原理详解(六): 序列最小最优化(SMO)算法(Part I)" />
    <meta data-rh="true" property="og:url" content="https://zhuanlan.zhihu.com/p/64580199" />
    <meta data-rh="true" property="og:description"
        content="在前文 支持向量机原理详解(五): KKT条件(Part II)中，我们推导了非线性SVM对偶问题的KKT条件。在此基础上，本文介绍用于训练SVM的序列最小最优化算法，内容如下：SMO算法的停机条件SMO算法的思路解析求解两个变量…" />
    <meta data-rh="true" property="og:image"
        content="https://pica.zhimg.com/v2-a8c5ebd0d076ac04da53b599b8eb4e66_720w.jpg?source=172ae18b" />
    <meta data-rh="true" property="og:type" content="article" />
    <meta data-rh="true" property="og:site_name" content="知乎专栏" />
    <link data-rh="true" rel="apple-touch-icon"
        href="https://static.zhihu.com/heifetz/assets/apple-touch-icon-152.81060cab.png" />
    <link data-rh="true" rel="apple-touch-icon"
        href="https://static.zhihu.com/heifetz/assets/apple-touch-icon-152.81060cab.png" sizes="152x152" />
    <link data-rh="true" rel="apple-touch-icon"
        href="https://static.zhihu.com/heifetz/assets/apple-touch-icon-120.d5793cac.png" sizes="120x120" />
    <link data-rh="true" rel="apple-touch-icon"
        href="https://static.zhihu.com/heifetz/assets/apple-touch-icon-76.7abf3393.png" sizes="76x76" />
    <link data-rh="true" rel="apple-touch-icon"
        href="https://static.zhihu.com/heifetz/assets/apple-touch-icon-60.362a8eac.png" sizes="60x60" />
    <link crossorigin="" rel="shortcut icon" type="image/x-icon" href="https://static.zhihu.com/heifetz/favicon.ico" />
    <link crossorigin="" rel="search" type="application/opensearchdescription+xml"
        href="https://static.zhihu.com/heifetz/search.xml" title="知乎" />
    <link rel="dns-prefetch" href="//static.zhimg.com" />
    <link rel="dns-prefetch" href="//pica.zhimg.com" />
    <link rel="dns-prefetch" href="//picx.zhimg.com" />
    <link rel="dns-prefetch" href="//pic1.zhimg.com" />
    <link rel="dns-prefetch" href="//pic2.zhimg.com" />
    <link rel="dns-prefetch" href="//pic3.zhimg.com" />
    <link rel="dns-prefetch" href="//pic4.zhimg.com" />
    <link rel="dns-prefetch" href="//static.zhihu.com" />
    <script nonce="a8cc389f-88ce-4793-bb1b-325bb4cb8d2d"
        data-web-reporter-config="{&quot;platform&quot;:&quot;web&quot;,&quot;project&quot;:&quot;heifetz&quot;}">!function (e, t) { "object" == typeof exports && "undefined" != typeof module ? t(exports) : "function" == typeof define && define.amd ? define(["exports"], t) : t((e = e || self).webReporter = {}) }(this, function (e) { "use strict"; var t = {}, n = !1, o = function () { var e, o, r, a, i; return n || (e = document.querySelector("script[data-web-reporter-config]"), o = e && e.dataset.webReporterConfig || "{}", r = JSON.parse(o), a = r.platform, i = r.project, t = { platform: a, project: i }, n = !0), t }; function r(e) { return a(function () { return localStorage.getItem(e) })() } function a(e) { return function () { try { return e.apply(void 0, arguments) } catch (e) { } } } var i = a(function (e, t) { var n = { platform: "web", project: o().project, clientTimestamp: +new Date }; !function (e, t, n) { "1" === r("weber:logenabled") && console.log("[web-reporter]%o", { type: e, base: t, data: n }) }(e, n, t), function (e, t) { var n = btoa(JSON.stringify(t)); if ("undefined" != typeof Blob && window.navigator && window.navigator.sendBeacon) { var o = new Blob([n], { type: "text/plain" }); navigator.sendBeacon(e, o) } else { var r = new XMLHttpRequest; r.open("POST", e), r.withCredentials = !1, r.setRequestHeader("Content-Type", "text/plain;charset=UTF-8"), r.send(n) } }(r("weber:api") || "https://apm.zhihu.com/collector/web_json", { type: e, base: n, data: t }) }); e.report = i, Object.defineProperty(e, "__esModule", { value: !0 }) });
        </script>
    <link href="https://static.zhihu.com/heifetz/2319.216a26f4.3606567ff197aceb4808.css" crossorigin=""
        rel="stylesheet" />
    <link href="https://static.zhihu.com/heifetz/column.216a26f4.f32f3564fcccdb253e7d.css" crossorigin=""
        rel="stylesheet" />
    <script nonce="a8cc389f-88ce-4793-bb1b-325bb4cb8d2d">!function () { "use strict"; !function (e, n) { var r = []; function t(e) { return function () { r.push([e, arguments]) } } n.Raven = { captureException: t("captureException"), captureMessage: t("captureMessage"), captureBreadcrumb: t("captureBreadcrumb") }; var a, o, c, i, s, u = "undefined" != typeof DOMError; function d(e) { var n = e instanceof Error || e instanceof ErrorEvent || u && e instanceof DOMError || e instanceof DOMException; Raven.captureException(n ? e : new Error(e.message || e.reason)) } n.addEventListener("unhandledrejection", d), n.addEventListener("error", d, !0), a = e.src, o = e, c = function () { r.forEach(function (e) { var n; (n = Raven)[e[0]].apply(n, e[1]) }), n.removeEventListener("unhandledrejection", d), n.removeEventListener("error", d, !0) }, i = document.head || document.getElementsByTagName("head")[0], (s = document.createElement("script")).crossOrigin = o.crossOrigin, s.dataset.sentryConfig = o["data-sentry-config"], s.onload = c, s.src = a, i.appendChild(s) }({ "defer": true, "crossOrigin": "anonymous", "src": "https://unpkg.zhimg.com/@cfe/sentry-script@1.3.1/dist/init.js", "data-sentry-config": "{\"dsn\":\"https://2d8d764432cc4f6fb3bc78ab9528299d@crash2.zhihu.com/1224\",\"sampleRate\":0.1,\"release\":\"793-d137d52f\",\"ignoreErrorNames\":[\"NetworkError\",\"SecurityError\"],\"ignoreErrorsPreset\":\"ReactApp\",\"tags\":{\"app_name\":\"heifetz\"}}" }, window) }();
    </script>
</head>

<body class="WhiteBg-body PostIndex-body">
    <div id="root">
        <div class="App">
            <style data-emotion-css="uzm3ri">
                .css-uzm3ri {
                    position: fixed;
                    top: 0;
                    right: 0;
                    left: 0;
                    z-index: 101;
                    display: none;
                    height: 2px;
                    pointer-events: none;
                    background: #056DE8;
                    -webkit-transform: translateX(-100%);
                    -ms-transform: translateX(-100%);
                    transform: translateX(-100%);
                }
            </style>
            <div class="LoadingBar  css-uzm3ri"></div>
            <div><span style="position:absolute;top:-10000px;left:-10000px" role="log" aria-live="assertive"></span>
            </div>
            <main role="main" class="App-main">
                <div class="Post-content" data-zop-usertoken="{&quot;userToken&quot;:&quot;&quot;}"
                    data-zop="{&quot;authorName&quot;:&quot;名利不如闲&quot;,&quot;itemId&quot;:64580199,&quot;title&quot;:&quot;支持向量机原理详解(六): 序列最小最优化(SMO)算法(Part I)&quot;,&quot;type&quot;:&quot;article&quot;}">
                    <div class="ColumnPageHeader-Wrapper">
                        <div>
                            <style data-emotion-css="1l12z7y">
                                .css-1l12z7y {
                                    box-shadow: 0px 16px 32px rgba(0, 0, 0, 0.04);
                                }
                            </style>
                            <div class="Sticky ColumnPageHeader css-1l12z7y">
                                <div class="ColumnPageHeader-content"><a href="//www.zhihu.com" aria-label="知乎">
                                        <style data-emotion-css="1hlrcxk">
                                            .css-1hlrcxk {
                                                -webkit-transition-property: fill;
                                                transition-property: fill;
                                                -webkit-transition-duration: 0.25s;
                                                transition-duration: 0.25s;
                                                -webkit-transition-timing-function: ease-in;
                                                transition-timing-function: ease-in;
                                            }
                                        </style><svg viewBox="0 0 64 30" fill="#056DE8" width="64" height="30"
                                            class="css-1hlrcxk">
                                            <path
                                                d="M29.05 4.582H16.733V25.94h3.018l.403 2.572 4.081-2.572h4.815V4.582zm-5.207 18.69l-2.396 1.509-.235-1.508h-1.724V7.233h6.78v16.04h-2.425zM14.46 14.191H9.982c0-.471.033-.954.039-1.458v-5.5h5.106V5.935a1.352 1.352 0 0 0-.404-.957 1.378 1.378 0 0 0-.968-.396H5.783c.028-.088.056-.177.084-.255.274-.82 1.153-3.326 1.153-3.326a4.262 4.262 0 0 0-2.413.698c-.57.4-.912.682-1.371 1.946-.532 1.453-.997 2.856-1.31 3.693C1.444 8.674.28 11.025.28 11.025a5.85 5.85 0 0 0 2.52-.61c1.119-.593 1.679-1.502 2.054-2.883l.09-.3h2.334v5.5c0 .5-.045.982-.073 1.46h-4.12c-.71 0-1.39.278-1.893.775a2.638 2.638 0 0 0-.783 1.874h6.527a17.717 17.717 0 0 1-.778 3.649 16.796 16.796 0 0 1-3.012 5.273A33.104 33.104 0 0 1 0 28.74s3.13 1.175 5.425-.954c1.388-1.292 2.631-3.814 3.23-5.727a28.09 28.09 0 0 0 1.12-5.229h5.967v-1.37a1.254 1.254 0 0 0-.373-.899 1.279 1.279 0 0 0-.909-.37z">
                                            </path>
                                            <path
                                                d="M11.27 19.675l-2.312 1.491 5.038 7.458a6.905 6.905 0 0 0 .672-2.218 3.15 3.15 0 0 0-.28-2.168l-3.118-4.563zM51.449 15.195V5.842c4.181-.205 7.988-.405 9.438-.483l.851-.05c.387-.399.885-2.395.689-3.021-.073-.25-.213-.666-.638-.555a33.279 33.279 0 0 1-4.277.727c-2.766.321-3.97.404-7.804.682-6.718.487-12.709.72-12.709.72a2.518 2.518 0 0 0 .788 1.834 2.567 2.567 0 0 0 1.883.706c2.278-.095 5.598-.25 8.996-.41v9.203h-12.78c0 .703.281 1.377.783 1.874a2.69 2.69 0 0 0 1.892.777h10.105v7.075c0 .887-.464 1.192-1.231 1.214h-3.92a4.15 4.15 0 0 0 .837 1.544 4.2 4.2 0 0 0 1.403 1.067 6.215 6.215 0 0 0 2.71.277c1.36-.066 2.967-.826 2.967-3.57v-7.607h11.28c.342 0 .67-.135.91-.374.242-.239.378-.563.378-.902v-1.375H51.449z">
                                            </path>
                                            <path
                                                d="M42.614 8.873a2.304 2.304 0 0 0-1.508-.926 2.334 2.334 0 0 0-1.727.405l-.376.272 4.255 5.85 2.24-1.62-2.884-3.98zM57.35 8.68l-3.125 4.097 2.24 1.663 4.517-5.927-.375-.277a2.32 2.32 0 0 0-1.722-.452 2.327 2.327 0 0 0-1.536.896z">
                                            </path>
                                        </svg>
                                    </a><i class="ColumnPageHeader-Line"></i>
                                    <div class="ColumnPageHeader-Title">
                                        <div class="ColumnPageHeader-TitleName"><span
                                                class="ColumnPageHeader-TitleMeta">首发于</span><a
                                                class="ColumnLink ColumnPageHeader-TitleColumn"
                                                href="//www.zhihu.com/column/c_1091644779288514560">几种机器学习算法的原理&amp;sklearn</a>
                                        </div>
                                    </div>
                                    <div class="ColumnPageHeader-Button">
                                        <div class="Popover"><button title="更多" id="null-toggle" aria-haspopup="true"
                                                aria-expanded="false" aria-owns="null-content" type="button"
                                                class="Button ColumnPageHeader-MenuToggler Button--plain"><svg
                                                    width="24" height="24" viewBox="0 0 24 24" class="Zi Zi--Dots"
                                                    fill="currentColor">
                                                    <path fill-rule="evenodd"
                                                        d="M5.83 12a1.665 1.665 0 1 1-3.33 0 1.665 1.665 0 0 1 3.33 0Zm7.835 0a1.665 1.665 0 1 1-3.33 0 1.665 1.665 0 0 1 3.33 0Zm6.17 1.665a1.665 1.665 0 1 0 0-3.33 1.665 1.665 0 0 0 0 3.33Z"
                                                        clip-rule="evenodd"></path>
                                                </svg></button></div><button type="button"
                                            class="Button ColumnPageHeader-WriteButton Button--blue"><svg width="24"
                                                height="24" viewBox="0 0 24 24" class="Zi Zi--EditSurround"
                                                fill="currentColor">
                                                <path fill-rule="evenodd"
                                                    d="M3.55 5.97a2.415 2.415 0 0 1 2.415-2.416h7.56a.75.75 0 0 1 0 1.5h-7.56a.915.915 0 0 0-.915.915v12.072c0 .505.41.915.915.915h12.074c.506 0 .915-.41.915-.915v-7.557a.75.75 0 0 1 1.5 0v7.557a2.415 2.415 0 0 1-2.415 2.415H5.965A2.415 2.415 0 0 1 3.55 18.04V5.969Z"
                                                    clip-rule="evenodd"></path>
                                                <path fill-rule="evenodd"
                                                    d="M20.239 3.77a.75.75 0 0 1 0 1.06l-8.206 8.206a.75.75 0 0 1-1.06-1.06l8.205-8.206a.75.75 0 0 1 1.06 0Z"
                                                    clip-rule="evenodd"></path>
                                            </svg>写文章</button>
                                    </div>
                                </div>
                                <div class="ColumnPageHeader-profile"><button type="button"
                                        class="Button AppHeader-profileEntry Button--plain">
                                        <style data-emotion-css="icip60">
                                            .css-icip60 {
                                                border-radius: 2px;
                                            }
                                        </style>
                                        <style data-emotion-css="1tzrnvf">
                                            .css-1tzrnvf {
                                                box-sizing: border-box;
                                                margin: 0;
                                                min-width: 0;
                                                max-width: 100%;
                                                height: auto;
                                                background-color: #FFFFFF;
                                                width: 30px;
                                                height: 30px;
                                                border-radius: 2px;
                                            }
                                        </style><img class="Avatar AppHeader-profileAvatar css-1tzrnvf"
                                            src="https://pic1.zhimg.com/v2-abed1a8c04700ba7d72b45195223e0ff_l.jpeg"
                                            srcSet="https://pic1.zhimg.com/v2-abed1a8c04700ba7d72b45195223e0ff_l.jpeg 2x"
                                            alt="点击打开undefined的主页" />
                                    </button></div>
                            </div>
                        </div>
                    </div>


                    <article class="Post-Main Post-NormalMain" tabindex="-1">
                        <header class="Post-Header">
                            <h1 class="Post-Title">支持向量机原理详解(六): 序列最小最优化(SMO)算法(Part I)</h1>
                            <div class="Post-Author">
                                <div class="AuthorInfo" itemProp="author" itemscope=""
                                    itemType="http://schema.org/Person">
                                    <div class="AuthorInfo">

                                            </a></span>
                                        <div class="AuthorInfo-content">
                                            <div class="AuthorInfo-head"><span class="UserLink AuthorInfo-name"><a
                                                        href="//www.zhihu.com/people/rookie-10" target="_blank"
                                                        class="UserLink-link"
                                                        data-za-detail-view-element_name="User">名利不如闲</a>
                                                    <style data-emotion-css="1cd9gw4">
                                                        .css-1cd9gw4 {
                                                            margin-left: .3em;
                                                        }
                                                    </style>
                                                </span></div>
                                            <div class="AuthorInfo-detail">
                                                <div class="AuthorInfo-badge">
                                                    <div class="ztext AuthorInfo-badgeText css-0">佛系科研。</div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div><button type="button"
                                    class="Button FollowButton Button--primary Button--grey">已关注</button>
                            </div>
                            <div role="button" tabindex="0"><span class="Voters"><button type="button"
                                        class="Button Button--plain">60 人<!-- -->赞同了该文章</button></span></div>
                        </header>
                        <div class="Post-RichTextContainer">
                            <style data-emotion-css="1yuhvjn">
                                .css-1yuhvjn {
                                    margin-top: 16px;
                                }
                            </style>
                            <div class="css-1yuhvjn">
                                <style data-emotion-css="376mun">
                                    .css-376mun {
                                        position: relative;
                                        display: inline;
                                    }
                                </style>
                                <div class="css-376mun">
                                    <style data-emotion-css="1hhle02">
                                        .css-1hhle02 .FileLinkCard {
                                            -webkit-align-items: center;
                                            -webkit-box-align: center;
                                            -ms-flex-align: center;
                                            align-items: center;
                                            background-color: rgba(246, 246, 246, 0.88);
                                            border-radius: 12px;
                                            box-sizing: border-box;
                                            display: -webkit-box;
                                            display: -webkit-flex;
                                            display: -ms-flexbox;
                                            display: flex;
                                            margin: 1em auto;
                                            max-width: 100%;
                                            overflow: hidden;
                                            padding: 12px;
                                            position: relative;
                                            width: 390px;
                                        }

                                        .css-1hhle02 .FileLinkCard-icon {
                                            -webkit-flex-shrink: 0;
                                            -ms-flex-negative: 0;
                                            flex-shrink: 0;
                                            height: 30px;
                                            width: 30px;
                                        }

                                        .css-1hhle02 .FileLinkCard-info {
                                            margin-left: 12px;
                                        }

                                        .css-1hhle02 .FileLinkCard-name {
                                            color: #121212;
                                            font-size: 15px;
                                            font-weight: 500;
                                            line-height: 21px;
                                            display: -webkit-box;
                                            text-overflow: ellipsis;
                                            overflow: hidden;
                                            -webkit-box-orient: vertical;
                                            -webkit-line-clamp: 2;
                                        }

                                        .css-1hhle02 .FileLinkCard-meta {
                                            color: #999999;
                                            font-size: 12px;
                                            display: -webkit-box;
                                            display: -webkit-flex;
                                            display: -ms-flexbox;
                                            display: flex;
                                            line-height: 14px;
                                            margin-top: 5px;
                                        }

                                        .css-1hhle02 .FileLinkCard-source {
                                            white-space: pre;
                                        }

                                        .css-1hhle02 img[data-uncomfortable] {
                                            content: url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20344.88888888888886%20194%22%3E%3CforeignObject%20width%3D%22344.88888888888886%22%20height%3D%22194%22%3E%0A%20%20%20%20%20%20%3Cdiv%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%22%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20-apple-system%2C%20BlinkMacSystemFont%2C%20Microsoft%20YaHei%2C%20sans-serif%3B%20color%3A%20%23fff%3B%20width%3A100%25%3B%20height%3A194px%3B%22%3E%0A%20%20%20%20%20%20%20%20%3Cdiv%20style%3D%22display%3A%20flex%3B%20flex-direction%3A%20column%3B%20align-items%3A%20center%3B%20justify-content%3A%20center%3B%20height%3A%20100%25%3B%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2218%22%20height%3D%2218%22%20viewBox%3D%220%200%2016%2016%22%20fill%3D%22currentColor%22%3E%3Cpath%20d%3D%22M8%203.65a7%207%200%2000-1.353.128.65.65%200%2011-.25-1.275A8.3%208.3%200%20018%202.35c2.387%200%204.172.954%205.357%202.125C14.511%205.615%2015.15%207.022%2015.15%208c0%20.621-.257%201.391-.699%202.134a7.076%207.076%200%2001-1.403%201.68l.495.46a.65.65%200%2011-.886.951l-.998-.929a.645.645%200%2001-.104-.097L9.73%2010.501a.647.647%200%2001-.29.301%203.15%203.15%200%2001-4.313-4.094.647.647%200%2001.234-.275L3.908%205.08a5.774%205.774%200%2000-1.283%201.522C2.282%207.198%202.15%207.707%202.15%208c0%20.522.41%201.616%201.407%202.6.965.954%202.43%201.75%204.443%201.75.468%200%20.905-.043%201.311-.12a.65.65%200%2001.243%201.277A8.322%208.322%200%20018%2013.65c-2.387%200-4.172-.954-5.357-2.125C1.49%2010.385.85%208.978.85%208c0-.598.238-1.333.648-2.046A7.054%207.054%200%20012.95%204.188l-.547-.509a.65.65%200%2011.886-.951l8.8%208.194a5.793%205.793%200%20001.244-1.453c.372-.624.516-1.163.516-1.469%200-.522-.41-1.616-1.407-2.6-.965-.954-2.43-1.75-4.443-1.75zM6.29%207.296a1.85%201.85%200%20002.534%202.36l-2.535-2.36zM8%204.85a.65.65%200%20100%201.3%201.85%201.85%200%20011.843%201.694.65.65%200%20101.296-.11A3.15%203.15%200%20008%204.85z%22%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E%0A%20%20%20%20%20%20%20%20%20%20%3Cdiv%20style%3D%22margin%3A%20.6em%200%201.2em%22%3E%E8%AF%A5%E5%9B%BE%E7%89%87%E6%9C%89%E5%8F%AF%E8%83%BD%E4%BC%9A%E5%BC%95%E8%B5%B7%E4%B8%8D%E9%80%82%3C%2Fdiv%3E%0A%20%20%20%20%20%20%20%20%20%20%3Cbutton%20style%3D%22padding%3A%204px%201em%3B%20font-size%3A%201.1em%3B%20color%3A%20inherit%3B%20background%3A%20none%3B%20border%3A%201px%20solid%20rgba%28255%2C255%2C255%2C.5%29%3B%20border-radius%3A%209999px%3B%22%3E%E7%BB%A7%E7%BB%AD%E6%9F%A5%E7%9C%8B%3C%2Fbutton%3E%0A%20%20%20%20%20%20%20%20%3C%2Fdiv%3E%0A%20%20%20%20%20%20%3C%2Fdiv%3E%0A%20%20%20%20%3C%2FforeignObject%3E%3C%2Fsvg%3E);
                                            width: 100%;
                                            height: 194px;
                                            background: url(https://pic1.zhimg.com/v2-cf70d0759d787c70091857151c1cad4a.jpeg) no-repeat rgba(191, 191, 191, 0.7);
                                            background-size: cover;
                                            cursor: pointer !important;
                                        }
                                    </style>
                                    <style data-emotion-css="1wr1m8">
                                        .css-1wr1m8 .LinkCard.new {
                                            position: relative;
                                            display: -webkit-box;
                                            display: -webkit-flex;
                                            display: -ms-flexbox;
                                            display: flex;
                                            box-sizing: border-box;
                                            -webkit-flex-direction: row;
                                            -ms-flex-direction: row;
                                            flex-direction: row;
                                            -webkit-align-items: center;
                                            -webkit-box-align: center;
                                            -ms-flex-align: center;
                                            align-items: center;
                                            width: 390px;
                                            min-height: 84px;
                                            border-radius: 8px;
                                            max-width: 100%;
                                            overflow: hidden;
                                            margin: 16px auto;
                                            padding: 12px 12px 9px 12px;
                                            background-color: #F6F6F6;
                                        }

                                        .css-1wr1m8 .LinkCard.new,
                                        .css-1wr1m8 .LinkCard.new:hover {
                                            -webkit-text-decoration: none;
                                            text-decoration: none;
                                            border: none !important;
                                            color: inherit !important;
                                        }

                                        .css-1wr1m8 .LinkCard.new .LinkCard-contents {
                                            display: block;
                                            -webkit-flex: 1 1 auto;
                                            -ms-flex: 1 1 auto;
                                            flex: 1 1 auto;
                                            position: relative;
                                        }

                                        .css-1wr1m8 .LinkCard.new .LinkCard-contents .loading {
                                            height: 14px;
                                            background: #EBEBEB;
                                            border-radius: 7px;
                                        }

                                        .css-1wr1m8 .LinkCard.new .LinkCard-contents.withTitle {
                                            margin-bottom: 3px;
                                        }

                                        .css-1wr1m8 .LinkCard.new .LinkCard-title {
                                            display: -webkit-box;
                                            font-size: 15px;
                                            font-weight: 500;
                                            line-height: 1.4;
                                            margin-bottom: 2px;
                                            color: #121212;
                                            text-overflow: ellipsis;
                                            overflow: hidden;
                                            -webkit-box-orient: vertical;
                                            -webkit-line-clamp: 1;
                                        }

                                        .css-1wr1m8 .LinkCard.new .LinkCard-title.two-line {
                                            line-height: 20px;
                                            display: -webkit-box;
                                            text-overflow: ellipsis;
                                            overflow: hidden;
                                            -webkit-box-orient: vertical;
                                            -webkit-line-clamp: 2;
                                        }

                                        .css-1wr1m8 .LinkCard.new .LinkCard-title.loading {
                                            margin-bottom: 8px;
                                            width: 80%;
                                        }

                                        .css-1wr1m8 .LinkCard.new .LinkCard-title.loading.withTitle {
                                            margin-bottom: 6px;
                                        }

                                        .css-1wr1m8 .LinkCard.new .LinkCard-title.loadingTitle {
                                            margin-bottom: 5px;
                                        }

                                        .css-1wr1m8 .LinkCard.new .LinkCard-excerpt {
                                            display: -webkit-box;
                                            text-overflow: ellipsis;
                                            font-size: 13px;
                                            line-height: 18px;
                                            color: #999999;
                                            margin-bottom: 4px;
                                            overflow: hidden;
                                            -webkit-box-orient: vertical;
                                            -webkit-line-clamp: 1;
                                        }

                                        .css-1wr1m8 .LinkCard.new .LinkCard-excerpt .LinkCard-author {
                                            color: #444444;
                                        }

                                        .css-1wr1m8 .LinkCard.new .LinkCard-desc {
                                            display: -webkit-box;
                                            font-size: 13px;
                                            height: 18px;
                                            line-height: 18px;
                                            color: #999999;
                                            word-break: break-all;
                                            text-overflow: ellipsis;
                                            overflow: hidden;
                                            -webkit-box-orient: vertical;
                                            -webkit-line-clamp: 1;
                                        }

                                        .css-1wr1m8 .LinkCard.new .LinkCard-desc .LinkCard-tag,
                                        .css-1wr1m8 .LinkCard.new .LinkCard-desc .tag {
                                            display: inline-block;
                                            font-size: 11px;
                                            margin-left: 8px;
                                            padding: 0 4px;
                                            border-radius: 3px;
                                            background: rgba(211, 211, 211, 0.3);
                                        }

                                        .css-1wr1m8 .LinkCard.new .LinkCard-desc.loading {
                                            width: 40%;
                                        }

                                        .css-1wr1m8 .LinkCard.new .LinkCard-desc svg {
                                            margin-right: 2px;
                                        }

                                        .css-1wr1m8 .LinkCard.new .LinkCard-image {
                                            -webkit-flex: 0 0 auto;
                                            -ms-flex: 0 0 auto;
                                            flex: 0 0 auto;
                                            background-color: #EBEBEB;
                                            background-size: cover;
                                            background-position: center;
                                            position: relative;
                                            display: block;
                                            width: 60px;
                                            height: 60px;
                                            margin-left: 20px;
                                            object-fit: cover;
                                            border-radius: inherit;
                                            overflow: hidden;
                                        }

                                        .css-1wr1m8 .LinkCard.new .LinkCard-image.LinkCard-image--default {
                                            display: -webkit-box;
                                            display: -webkit-flex;
                                            display: -ms-flexbox;
                                            display: flex;
                                            -webkit-align-items: center;
                                            -webkit-box-align: center;
                                            -ms-flex-align: center;
                                            align-items: center;
                                            -webkit-box-pack: center;
                                            -webkit-justify-content: center;
                                            -ms-flex-pack: center;
                                            justify-content: center;
                                            background-color: #EBEBEB;
                                            color: #D3D3D3;
                                        }

                                        .css-1wr1m8 .LinkCard.new .LinkCard-image.LinkCard-image--default svg {
                                            color: #999999;
                                        }

                                        .css-1wr1m8 .LinkCard.new .LinkCard-image img {
                                            width: 100%;
                                            height: 100%;
                                            object-fit: cover;
                                        }

                                        .css-1wr1m8 .LinkCard.new .LinkCard-image .LinkCard-image--video {
                                            display: -webkit-box;
                                            display: -webkit-flex;
                                            display: -ms-flexbox;
                                            display: flex;
                                            -webkit-align-items: center;
                                            -webkit-box-align: center;
                                            -ms-flex-align: center;
                                            align-items: center;
                                            -webkit-box-pack: center;
                                            -webkit-justify-content: center;
                                            -ms-flex-pack: center;
                                            justify-content: center;
                                            position: absolute;
                                            top: 50%;
                                            left: 50%;
                                            -webkit-transform: translateX(-50%) translateY(-50%);
                                            -ms-transform: translateX(-50%) translateY(-50%);
                                            transform: translateX(-50%) translateY(-50%);
                                            width: 24px;
                                            height: 24px;
                                            border-radius: 12px;
                                            background: rgba(255, 255, 255, 0.9);
                                            pointer-events: none;
                                        }

                                        .css-1wr1m8 .LinkCard.new .LinkCard-image .LinkCard-image--video svg {
                                            color: #444444;
                                        }

                                        .css-1wr1m8 .LinkCard.new .LinkCard-richText .text {
                                            color: #444444;
                                        }

                                        .css-1wr1m8 .LinkCard.new .LinkCard-richText .bold {
                                            font-weight: 600;
                                        }

                                        .css-1wr1m8 .LinkCard.new .LinkCard-richText .tag {
                                            margin-left: 4px;
                                        }

                                        .css-1wr1m8 .LinkCard.old {
                                            position: relative;
                                            display: block;
                                            margin: 1em auto;
                                            width: 390px;
                                            box-sizing: border-box;
                                            border-radius: 12px;
                                            max-width: 100%;
                                            overflow: hidden;
                                        }

                                        .css-1wr1m8 .LinkCard.old,
                                        .css-1wr1m8 .LinkCard.old:hover {
                                            -webkit-text-decoration: none;
                                            text-decoration: none;
                                            border: none !important;
                                            color: inherit !important;
                                        }

                                        .css-1wr1m8 .LinkCard-ecommerceLoadingCard {
                                            position: relative;
                                            display: -webkit-box;
                                            display: -webkit-flex;
                                            display: -ms-flexbox;
                                            display: flex;
                                            -webkit-align-items: center;
                                            -webkit-box-align: center;
                                            -ms-flex-align: center;
                                            align-items: center;
                                            -webkit-box-pack: justify;
                                            -webkit-justify-content: space-between;
                                            -ms-flex-pack: justify;
                                            justify-content: space-between;
                                            padding: 12px;
                                            border-radius: inherit;
                                            height: 80px;
                                            box-sizing: border-box;
                                            background: rgba(246, 246, 246, 0.88);
                                            color: #D3D3D3;
                                        }

                                        .css-1wr1m8 .LinkCard-ecommerceLoadingCardAvatarWrapper {
                                            width: 60px;
                                            height: 60px;
                                            background: #EBEBEB;
                                            display: -webkit-box;
                                            display: -webkit-flex;
                                            display: -ms-flexbox;
                                            display: flex;
                                            -webkit-align-items: center;
                                            -webkit-box-align: center;
                                            -ms-flex-align: center;
                                            align-items: center;
                                            -webkit-box-pack: center;
                                            -webkit-justify-content: center;
                                            -ms-flex-pack: center;
                                            justify-content: center;
                                            border-radius: 6px;
                                            margin-right: 10px;
                                        }

                                        .css-1wr1m8 .LinkCard-ecommerceLoadingCardNetwork {
                                            width: 20px;
                                            height: 20px;
                                        }

                                        .css-1wr1m8 .LinkCard-ecommerceLoadingCardLoadingbar {
                                            height: 60px;
                                            -webkit-flex: 1;
                                            -ms-flex: 1;
                                            flex: 1;
                                            display: -webkit-box;
                                            display: -webkit-flex;
                                            display: -ms-flexbox;
                                            display: flex;
                                            -webkit-flex-direction: column;
                                            -ms-flex-direction: column;
                                            flex-direction: column;
                                        }

                                        .css-1wr1m8 .LinkCard-ecommerceLoadingCardLoadingbar span {
                                            height: 16px;
                                            display: inline-block;
                                            background: #EBEBEB;
                                        }

                                        .css-1wr1m8 .LinkCard-ecommerceLoadingCardLoadingbar span:nth-of-type(1) {
                                            width: 60px;
                                            margin-bottom: 4px;
                                        }

                                        .css-1wr1m8 .LinkCard-ecommerceLoadingCardLoadingbar span:nth-of-type(2) {
                                            width: 127px;
                                        }
                                    </style>
                                    <style data-emotion-css="1dnyyvy">
                                        .css-1dnyyvy .LinkCard.old {
                                            position: relative;
                                            display: block;
                                            margin: 1em auto;
                                            width: 390px;
                                            box-sizing: border-box;
                                            border-radius: 12px;
                                            max-width: 100%;
                                            overflow: hidden;
                                        }

                                        .css-1dnyyvy .LinkCard.old,
                                        .css-1dnyyvy .LinkCard.old:hover {
                                            -webkit-text-decoration: none;
                                            text-decoration: none;
                                            border: none !important;
                                            color: inherit !important;
                                        }

                                        .css-1dnyyvy .LinkCard-ecommerceLoadingCard {
                                            position: relative;
                                            display: -webkit-box;
                                            display: -webkit-flex;
                                            display: -ms-flexbox;
                                            display: flex;
                                            -webkit-align-items: center;
                                            -webkit-box-align: center;
                                            -ms-flex-align: center;
                                            align-items: center;
                                            -webkit-box-pack: justify;
                                            -webkit-justify-content: space-between;
                                            -ms-flex-pack: justify;
                                            justify-content: space-between;
                                            padding: 12px;
                                            border-radius: inherit;
                                            height: 80px;
                                            box-sizing: border-box;
                                            background: rgba(246, 246, 246, 0.88);
                                            color: #D3D3D3;
                                        }

                                        .css-1dnyyvy .LinkCard-ecommerceLoadingCardAvatarWrapper {
                                            width: 60px;
                                            height: 60px;
                                            background: #EBEBEB;
                                            display: -webkit-box;
                                            display: -webkit-flex;
                                            display: -ms-flexbox;
                                            display: flex;
                                            -webkit-align-items: center;
                                            -webkit-box-align: center;
                                            -ms-flex-align: center;
                                            align-items: center;
                                            -webkit-box-pack: center;
                                            -webkit-justify-content: center;
                                            -ms-flex-pack: center;
                                            justify-content: center;
                                            border-radius: 6px;
                                            margin-right: 10px;
                                        }

                                        .css-1dnyyvy .LinkCard-ecommerceLoadingCardNetwork {
                                            width: 20px;
                                            height: 20px;
                                        }

                                        .css-1dnyyvy .LinkCard-ecommerceLoadingCardLoadingbar {
                                            height: 60px;
                                            -webkit-flex: 1;
                                            -ms-flex: 1;
                                            flex: 1;
                                            display: -webkit-box;
                                            display: -webkit-flex;
                                            display: -ms-flexbox;
                                            display: flex;
                                            -webkit-flex-direction: column;
                                            -ms-flex-direction: column;
                                            flex-direction: column;
                                        }

                                        .css-1dnyyvy .LinkCard-ecommerceLoadingCardLoadingbar span {
                                            height: 16px;
                                            display: inline-block;
                                            background: #EBEBEB;
                                        }

                                        .css-1dnyyvy .LinkCard-ecommerceLoadingCardLoadingbar span:nth-of-type(1) {
                                            width: 60px;
                                            margin-bottom: 4px;
                                        }

                                        .css-1dnyyvy .LinkCard-ecommerceLoadingCardLoadingbar span:nth-of-type(2) {
                                            width: 127px;
                                        }

                                        .css-1dnyyvy .LinkCard.new {
                                            position: relative;
                                            display: -webkit-box;
                                            display: -webkit-flex;
                                            display: -ms-flexbox;
                                            display: flex;
                                            box-sizing: border-box;
                                            -webkit-flex-direction: row;
                                            -ms-flex-direction: row;
                                            flex-direction: row;
                                            -webkit-align-items: center;
                                            -webkit-box-align: center;
                                            -ms-flex-align: center;
                                            align-items: center;
                                            width: 390px;
                                            min-height: 84px;
                                            border-radius: 8px;
                                            max-width: 100%;
                                            overflow: hidden;
                                            margin: 16px auto;
                                            padding: 12px 12px 9px 12px;
                                            background-color: #F6F6F6;
                                        }

                                        .css-1dnyyvy .LinkCard.new,
                                        .css-1dnyyvy .LinkCard.new:hover {
                                            -webkit-text-decoration: none;
                                            text-decoration: none;
                                            border: none !important;
                                            color: inherit !important;
                                        }

                                        .css-1dnyyvy .LinkCard.new .LinkCard-contents {
                                            display: block;
                                            -webkit-flex: 1 1 auto;
                                            -ms-flex: 1 1 auto;
                                            flex: 1 1 auto;
                                            position: relative;
                                        }

                                        .css-1dnyyvy .LinkCard.new .LinkCard-contents .loading {
                                            height: 14px;
                                            background: #EBEBEB;
                                            border-radius: 7px;
                                        }

                                        .css-1dnyyvy .LinkCard.new .LinkCard-contents.withTitle {
                                            margin-bottom: 3px;
                                        }

                                        .css-1dnyyvy .LinkCard.new .LinkCard-title {
                                            display: -webkit-box;
                                            font-size: 15px;
                                            font-weight: 500;
                                            line-height: 1.4;
                                            margin-bottom: 2px;
                                            color: #121212;
                                            text-overflow: ellipsis;
                                            overflow: hidden;
                                            -webkit-box-orient: vertical;
                                            -webkit-line-clamp: 1;
                                        }

                                        .css-1dnyyvy .LinkCard.new .LinkCard-title.two-line {
                                            line-height: 20px;
                                            display: -webkit-box;
                                            text-overflow: ellipsis;
                                            overflow: hidden;
                                            -webkit-box-orient: vertical;
                                            -webkit-line-clamp: 2;
                                        }

                                        .css-1dnyyvy .LinkCard.new .LinkCard-title.loading {
                                            margin-bottom: 8px;
                                            width: 80%;
                                        }

                                        .css-1dnyyvy .LinkCard.new .LinkCard-title.loading.withTitle {
                                            margin-bottom: 6px;
                                        }

                                        .css-1dnyyvy .LinkCard.new .LinkCard-title.loadingTitle {
                                            margin-bottom: 5px;
                                        }

                                        .css-1dnyyvy .LinkCard.new .LinkCard-excerpt {
                                            display: -webkit-box;
                                            text-overflow: ellipsis;
                                            font-size: 13px;
                                            line-height: 18px;
                                            color: #999999;
                                            margin-bottom: 4px;
                                            overflow: hidden;
                                            -webkit-box-orient: vertical;
                                            -webkit-line-clamp: 1;
                                        }

                                        .css-1dnyyvy .LinkCard.new .LinkCard-excerpt .LinkCard-author {
                                            color: #444444;
                                        }

                                        .css-1dnyyvy .LinkCard.new .LinkCard-desc {
                                            display: -webkit-box;
                                            font-size: 13px;
                                            height: 18px;
                                            line-height: 18px;
                                            color: #999999;
                                            word-break: break-all;
                                            text-overflow: ellipsis;
                                            overflow: hidden;
                                            -webkit-box-orient: vertical;
                                            -webkit-line-clamp: 1;
                                        }

                                        .css-1dnyyvy .LinkCard.new .LinkCard-desc .LinkCard-tag,
                                        .css-1dnyyvy .LinkCard.new .LinkCard-desc .tag {
                                            display: inline-block;
                                            font-size: 11px;
                                            margin-left: 8px;
                                            padding: 0 4px;
                                            border-radius: 3px;
                                            background: rgba(211, 211, 211, 0.3);
                                        }

                                        .css-1dnyyvy .LinkCard.new .LinkCard-desc.loading {
                                            width: 40%;
                                        }

                                        .css-1dnyyvy .LinkCard.new .LinkCard-desc svg {
                                            margin-right: 2px;
                                        }

                                        .css-1dnyyvy .LinkCard.new .LinkCard-image {
                                            -webkit-flex: 0 0 auto;
                                            -ms-flex: 0 0 auto;
                                            flex: 0 0 auto;
                                            background-color: #EBEBEB;
                                            background-size: cover;
                                            background-position: center;
                                            position: relative;
                                            display: block;
                                            width: 60px;
                                            height: 60px;
                                            margin-left: 20px;
                                            object-fit: cover;
                                            border-radius: inherit;
                                            overflow: hidden;
                                        }

                                        .css-1dnyyvy .LinkCard.new .LinkCard-image.LinkCard-image--default {
                                            display: -webkit-box;
                                            display: -webkit-flex;
                                            display: -ms-flexbox;
                                            display: flex;
                                            -webkit-align-items: center;
                                            -webkit-box-align: center;
                                            -ms-flex-align: center;
                                            align-items: center;
                                            -webkit-box-pack: center;
                                            -webkit-justify-content: center;
                                            -ms-flex-pack: center;
                                            justify-content: center;
                                            background-color: #EBEBEB;
                                            color: #D3D3D3;
                                        }

                                        .css-1dnyyvy .LinkCard.new .LinkCard-image.LinkCard-image--default svg {
                                            color: #999999;
                                        }

                                        .css-1dnyyvy .LinkCard.new .LinkCard-image img {
                                            width: 100%;
                                            height: 100%;
                                            object-fit: cover;
                                        }

                                        .css-1dnyyvy .LinkCard.new .LinkCard-image .LinkCard-image--video {
                                            display: -webkit-box;
                                            display: -webkit-flex;
                                            display: -ms-flexbox;
                                            display: flex;
                                            -webkit-align-items: center;
                                            -webkit-box-align: center;
                                            -ms-flex-align: center;
                                            align-items: center;
                                            -webkit-box-pack: center;
                                            -webkit-justify-content: center;
                                            -ms-flex-pack: center;
                                            justify-content: center;
                                            position: absolute;
                                            top: 50%;
                                            left: 50%;
                                            -webkit-transform: translateX(-50%) translateY(-50%);
                                            -ms-transform: translateX(-50%) translateY(-50%);
                                            transform: translateX(-50%) translateY(-50%);
                                            width: 24px;
                                            height: 24px;
                                            border-radius: 12px;
                                            background: rgba(255, 255, 255, 0.9);
                                            pointer-events: none;
                                        }

                                        .css-1dnyyvy .LinkCard.new .LinkCard-image .LinkCard-image--video svg {
                                            color: #444444;
                                        }

                                        .css-1dnyyvy .LinkCard.new .LinkCard-richText .text {
                                            color: #444444;
                                        }

                                        .css-1dnyyvy .LinkCard.new .LinkCard-richText .bold {
                                            font-weight: 600;
                                        }

                                        .css-1dnyyvy .LinkCard.new .LinkCard-richText .tag {
                                            margin-left: 4px;
                                        }

                                        .css-1dnyyvy .FileLinkCard {
                                            -webkit-align-items: center;
                                            -webkit-box-align: center;
                                            -ms-flex-align: center;
                                            align-items: center;
                                            background-color: rgba(246, 246, 246, 0.88);
                                            border-radius: 12px;
                                            box-sizing: border-box;
                                            display: -webkit-box;
                                            display: -webkit-flex;
                                            display: -ms-flexbox;
                                            display: flex;
                                            margin: 1em auto;
                                            max-width: 100%;
                                            overflow: hidden;
                                            padding: 12px;
                                            position: relative;
                                            width: 390px;
                                        }

                                        .css-1dnyyvy .FileLinkCard-icon {
                                            -webkit-flex-shrink: 0;
                                            -ms-flex-negative: 0;
                                            flex-shrink: 0;
                                            height: 30px;
                                            width: 30px;
                                        }

                                        .css-1dnyyvy .FileLinkCard-info {
                                            margin-left: 12px;
                                        }

                                        .css-1dnyyvy .FileLinkCard-name {
                                            color: #121212;
                                            font-size: 15px;
                                            font-weight: 500;
                                            line-height: 21px;
                                            display: -webkit-box;
                                            text-overflow: ellipsis;
                                            overflow: hidden;
                                            -webkit-box-orient: vertical;
                                            -webkit-line-clamp: 2;
                                        }

                                        .css-1dnyyvy .FileLinkCard-meta {
                                            color: #999999;
                                            font-size: 12px;
                                            display: -webkit-box;
                                            display: -webkit-flex;
                                            display: -ms-flexbox;
                                            display: flex;
                                            line-height: 14px;
                                            margin-top: 5px;
                                        }

                                        .css-1dnyyvy .FileLinkCard-source {
                                            white-space: pre;
                                        }

                                        .css-1dnyyvy img[data-uncomfortable] {
                                            content: url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20344.88888888888886%20194%22%3E%3CforeignObject%20width%3D%22344.88888888888886%22%20height%3D%22194%22%3E%0A%20%20%20%20%20%20%3Cdiv%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%22%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20-apple-system%2C%20BlinkMacSystemFont%2C%20Microsoft%20YaHei%2C%20sans-serif%3B%20color%3A%20%23fff%3B%20width%3A100%25%3B%20height%3A194px%3B%22%3E%0A%20%20%20%20%20%20%20%20%3Cdiv%20style%3D%22display%3A%20flex%3B%20flex-direction%3A%20column%3B%20align-items%3A%20center%3B%20justify-content%3A%20center%3B%20height%3A%20100%25%3B%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2218%22%20height%3D%2218%22%20viewBox%3D%220%200%2016%2016%22%20fill%3D%22currentColor%22%3E%3Cpath%20d%3D%22M8%203.65a7%207%200%2000-1.353.128.65.65%200%2011-.25-1.275A8.3%208.3%200%20018%202.35c2.387%200%204.172.954%205.357%202.125C14.511%205.615%2015.15%207.022%2015.15%208c0%20.621-.257%201.391-.699%202.134a7.076%207.076%200%2001-1.403%201.68l.495.46a.65.65%200%2011-.886.951l-.998-.929a.645.645%200%2001-.104-.097L9.73%2010.501a.647.647%200%2001-.29.301%203.15%203.15%200%2001-4.313-4.094.647.647%200%2001.234-.275L3.908%205.08a5.774%205.774%200%2000-1.283%201.522C2.282%207.198%202.15%207.707%202.15%208c0%20.522.41%201.616%201.407%202.6.965.954%202.43%201.75%204.443%201.75.468%200%20.905-.043%201.311-.12a.65.65%200%2001.243%201.277A8.322%208.322%200%20018%2013.65c-2.387%200-4.172-.954-5.357-2.125C1.49%2010.385.85%208.978.85%208c0-.598.238-1.333.648-2.046A7.054%207.054%200%20012.95%204.188l-.547-.509a.65.65%200%2011.886-.951l8.8%208.194a5.793%205.793%200%20001.244-1.453c.372-.624.516-1.163.516-1.469%200-.522-.41-1.616-1.407-2.6-.965-.954-2.43-1.75-4.443-1.75zM6.29%207.296a1.85%201.85%200%20002.534%202.36l-2.535-2.36zM8%204.85a.65.65%200%20100%201.3%201.85%201.85%200%20011.843%201.694.65.65%200%20101.296-.11A3.15%203.15%200%20008%204.85z%22%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E%0A%20%20%20%20%20%20%20%20%20%20%3Cdiv%20style%3D%22margin%3A%20.6em%200%201.2em%22%3E%E8%AF%A5%E5%9B%BE%E7%89%87%E6%9C%89%E5%8F%AF%E8%83%BD%E4%BC%9A%E5%BC%95%E8%B5%B7%E4%B8%8D%E9%80%82%3C%2Fdiv%3E%0A%20%20%20%20%20%20%20%20%20%20%3Cbutton%20style%3D%22padding%3A%204px%201em%3B%20font-size%3A%201.1em%3B%20color%3A%20inherit%3B%20background%3A%20none%3B%20border%3A%201px%20solid%20rgba%28255%2C255%2C255%2C.5%29%3B%20border-radius%3A%209999px%3B%22%3E%E7%BB%A7%E7%BB%AD%E6%9F%A5%E7%9C%8B%3C%2Fbutton%3E%0A%20%20%20%20%20%20%20%20%3C%2Fdiv%3E%0A%20%20%20%20%20%20%3C%2Fdiv%3E%0A%20%20%20%20%3C%2FforeignObject%3E%3C%2Fsvg%3E);
                                            width: 100%;
                                            height: 194px;
                                            background: url(https://pic1.zhimg.com/v2-cf70d0759d787c70091857151c1cad4a.jpeg) no-repeat rgba(191, 191, 191, 0.7);
                                            background-size: cover;
                                            cursor: pointer !important;
                                        }
                                    </style>
                                    <style data-emotion-css="1g0fqss animation-1yvu044">
                                        .css-1g0fqss {
                                            word-break: break-word;
                                            line-height: 1.6;
                                        }

                                        .css-1g0fqss>[data-first-child] {
                                            margin-top: 0;
                                        }

                                        .css-1g0fqss> :last-child {
                                            margin-bottom: 0;
                                        }

                                        .css-1g0fqss h1,
                                        .css-1g0fqss h2 {
                                            clear: left;
                                            margin-top: calc((1.4em * 2) / 1.2);
                                            margin-bottom: calc(1.4em / 1.2);
                                            font-size: 1.2em;
                                            line-height: 1.5;
                                            font-weight: 600;
                                        }

                                        .css-1g0fqss h3,
                                        .css-1g0fqss h4,
                                        .css-1g0fqss h5,
                                        .css-1g0fqss h6 {
                                            clear: left;
                                            margin-top: calc((1.4em * 1.5) / 1.1);
                                            margin-bottom: calc(1.4em / 1.1);
                                            font-size: 1.1em;
                                            line-height: 1.5;
                                            font-weight: 600;
                                        }

                                        .css-1g0fqss u {
                                            -webkit-text-decoration: none;
                                            text-decoration: none;
                                            border-bottom: 1px solid #444444;
                                        }

                                        .css-1g0fqss b {
                                            font-weight: 600;
                                        }

                                        .css-1g0fqss sup {
                                            font-size: 0.8em;
                                        }

                                        .css-1g0fqss sup[data-draft-type='reference'] {
                                            color: #175199;
                                        }

                                        .css-1g0fqss a:focus {
                                            outline: none;
                                            -webkit-transition: box-shadow 0.3s;
                                            transition: box-shadow 0.3s;
                                        }

                                        html[data-focus-visible] .css-1g0fqss a:focus {
                                            box-shadow: 0 0 0 2px #FFFFFF, 0 0 0 4px rgba(5, 109, 232, 0.3);
                                        }

                                        .css-1g0fqss a.ztext-link,
                                        .css-1g0fqss a.internal,
                                        .css-1g0fqss a.external {
                                            -webkit-text-decoration: none;
                                            text-decoration: none;
                                            cursor: pointer;
                                            border-bottom: 1px solid #808080;
                                        }

                                        .css-1g0fqss a.ztext-link:hover,
                                        .css-1g0fqss a.internal:hover,
                                        .css-1g0fqss a.external:hover {
                                            color: #175199;
                                            border-bottom: 1px solid #175199;
                                        }

                                        .css-1g0fqss a.ztext-link>.ellipsis::after,
                                        .css-1g0fqss a.internal>.ellipsis::after,
                                        .css-1g0fqss a.external>.ellipsis::after {
                                            content: '...';
                                        }

                                        .css-1g0fqss a.ztext-link>.invisible,
                                        .css-1g0fqss a.internal>.invisible,
                                        .css-1g0fqss a.external>.invisible {
                                            font: 0/0 a;
                                            color: transparent;
                                            text-shadow: none;
                                            background-color: transparent;
                                        }

                                        .css-1g0fqss a.ztext-link u,
                                        .css-1g0fqss a.internal u,
                                        .css-1g0fqss a.external u {
                                            border: none;
                                        }

                                        .css-1g0fqss a.member_mention {
                                            color: #175199;
                                        }

                                        .css-1g0fqss a.member_mention:hover {
                                            border-bottom: 1px solid #175199;
                                        }

                                        .css-1g0fqss a.UserLink-link {
                                            color: #175199;
                                        }

                                        .css-1g0fqss a.UserLink-link:hover {
                                            border-bottom: 1px solid #175199;
                                        }

                                        .css-1g0fqss p {
                                            margin: 1.4em 0;
                                        }

                                        .css-1g0fqss p.ztext-empty-paragraph {
                                            margin: calc((2.8em- (1.4em * 2 + 1.6em)) / 2) 0;
                                        }

                                        .css-1g0fqss p.ztext-empty-paragraph+.ztext-empty-paragraph {
                                            margin: 1.4em 0;
                                        }

                                        .css-1g0fqss hr {
                                            margin: 4em auto;
                                            width: 240px;
                                            max-width: 100%;
                                            border: none;
                                            border-top: 1px solid #D3D3D3;
                                        }

                                        .css-1g0fqss img[eeimg] {
                                            max-width: 100%;
                                            vertical-align: middle;
                                        }

                                        .css-1g0fqss img[eeimg="1"] {
                                            margin: 0 3px;
                                            max-width: calc(100% - 6px);
                                            display: inline-block;
                                        }

                                        .css-1g0fqss img[eeimg="2"] {
                                            margin: 1.4em auto;
                                            display: block;
                                        }

                                        .css-1g0fqss blockquote {
                                            margin: 1.4em 0;
                                            padding-left: 1em;
                                            color: #646464;
                                            border-left: 3px solid #D3D3D3;
                                        }

                                        .css-1g0fqss ol,
                                        .css-1g0fqss ul {
                                            margin: 1.4em 0;
                                            padding: 0;
                                            width: 100%;
                                        }

                                        .css-1g0fqss ol ol,
                                        .css-1g0fqss ul ol,
                                        .css-1g0fqss ol ul,
                                        .css-1g0fqss ul ul {
                                            margin: 0;
                                        }

                                        .css-1g0fqss ol li::before,
                                        .css-1g0fqss ul li::before {
                                            width: 1em;
                                        }

                                        .css-1g0fqss ol>ol,
                                        .css-1g0fqss ul>ol,
                                        .css-1g0fqss ol>ul,
                                        .css-1g0fqss ul>ul {
                                            display: table-row;
                                        }

                                        .css-1g0fqss ol>ol::before,
                                        .css-1g0fqss ul>ol::before,
                                        .css-1g0fqss ol>ul::before,
                                        .css-1g0fqss ul>ul::before {
                                            display: table-cell;
                                            content: '';
                                        }

                                        .css-1g0fqss ul {
                                            display: table;
                                        }

                                        .css-1g0fqss ul>li {
                                            display: table-row;
                                            list-style: none;
                                        }

                                        .css-1g0fqss ul>li::before {
                                            display: table-cell;
                                            content: '•  ';
                                            white-space: pre;
                                        }

                                        .css-1g0fqss ol {
                                            display: table;
                                            counter-reset: ol;
                                        }

                                        .css-1g0fqss ol>li {
                                            display: table-row;
                                            list-style: none;
                                        }

                                        .css-1g0fqss ol>li::before {
                                            display: table-cell;
                                            text-align: right;
                                            counter-increment: ol;
                                            content: counter(ol) '. ';
                                            white-space: pre;
                                        }

                                        .css-1g0fqss ol ol {
                                            counter-reset: ol2;
                                        }

                                        .css-1g0fqss ol ol li::before {
                                            counter-increment: ol2;
                                            content: counter(ol2) '. ';
                                        }

                                        .css-1g0fqss ol ol ol {
                                            counter-reset: ol3;
                                        }

                                        .css-1g0fqss ol ol ol li::before {
                                            counter-increment: ol3;
                                            content: counter(ol3) '. ';
                                        }

                                        .css-1g0fqss ol ol ol ol {
                                            counter-reset: ol4;
                                        }

                                        .css-1g0fqss ol ol ol ol li::before {
                                            counter-increment: ol4;
                                            content: counter(ol4) '. ';
                                        }

                                        .css-1g0fqss figure {
                                            margin: 1.4em 0;
                                        }

                                        .css-1g0fqss figure .content_image,
                                        .css-1g0fqss figure .origin_image {
                                            margin: 0 auto;
                                        }

                                        .css-1g0fqss figure figcaption {
                                            margin-top: calc(0.6em / 0.9);
                                            padding: 0 1em;
                                            font-size: 0.9em;
                                            line-height: 1.5;
                                            text-align: center;
                                            color: #999999;
                                        }

                                        .css-1g0fqss figure+figure {
                                            margin-top: calc(1.4em * 1.6);
                                        }

                                        .css-1g0fqss figure[data-size='small'],
                                        .css-1g0fqss figure:not([data-size])>[data-size='small'] {
                                            clear: both;
                                        }

                                        .css-1g0fqss figure[data-size='left'],
                                        .css-1g0fqss figure:not([data-size])>[data-size='left'] {
                                            float: left;
                                            margin: 0 20px 20px 0;
                                            max-width: 33%;
                                        }

                                        .css-1g0fqss figure[data-size='right'],
                                        .css-1g0fqss figure:not([data-size])>[data-size='right'] {
                                            float: right;
                                            margin: 0 0 20px 20px;
                                            max-width: 33%;
                                        }

                                        .css-1g0fqss figure[data-size='collapse'] {
                                            margin-bottom: 0;
                                        }

                                        .css-1g0fqss figure[data-size='collapse']+figure {
                                            margin-top: 0;
                                        }

                                        .css-1g0fqss .content_image,
                                        .css-1g0fqss .origin_image {
                                            display: block;
                                            max-width: 100%;
                                            height: auto;
                                            margin: 1.4em auto;
                                        }

                                        .css-1g0fqss .content_image[data-size='small'],
                                        .css-1g0fqss .origin_image[data-size='small'] {
                                            max-width: 40%;
                                        }

                                        .css-1g0fqss .content_image.zh-lightbox-thumb,
                                        .css-1g0fqss .origin_image.zh-lightbox-thumb {
                                            cursor: -webkit-zoom-in;
                                            cursor: -moz-zoom-in;
                                            cursor: zoom-in;
                                        }

                                        .css-1g0fqss code {
                                            margin: 0 2px;
                                            padding: 3px 4px;
                                            border-radius: 3px;
                                            font-family: Menlo, Monaco, Consolas, 'Andale Mono', 'lucida console', 'Courier New', monospace;
                                            font-size: 0.9em;
                                            background-color: #F6F6F6;
                                        }

                                        .css-1g0fqss pre {
                                            margin: 1.4em 0;
                                            padding: calc(0.8em / 0.9);
                                            font-size: 0.9em;
                                            word-break: initial;
                                            word-wrap: initial;
                                            white-space: pre;
                                            overflow: auto;
                                            -webkit-overflow-scrolling: touch;
                                            background: #F6F6F6;
                                            border-radius: 4px;
                                        }

                                        .css-1g0fqss pre code {
                                            margin: 0;
                                            padding: 0;
                                            font-size: inherit;
                                            border-radius: 0;
                                            background-color: inherit;
                                        }

                                        .css-1g0fqss li pre {
                                            white-space: pre-wrap;
                                        }

                                        .css-1g0fqss table[data-draft-type='table'] {
                                            border-collapse: collapse;
                                            font-size: 15px;
                                            margin: 1.4em auto;
                                            max-width: 100%;
                                            table-layout: fixed;
                                            text-align: left;
                                            width: 100%;
                                        }

                                        .css-1g0fqss table[data-draft-type='table'][data-size='small'] {
                                            min-width: 260px;
                                            width: 40%;
                                        }

                                        .css-1g0fqss table[data-draft-type='table'][data-row-style='striped'] tr:nth-of-type(2n + 1) {
                                            background: #F6F6F6;
                                        }

                                        .css-1g0fqss table[data-draft-type='table'] td,
                                        .css-1g0fqss table[data-draft-type='table'] th {
                                            border: 1px solid #D3D3D3;
                                            line-height: 24px;
                                            height: 24px;
                                            padding: 3px 12px;
                                        }

                                        .css-1g0fqss table[data-draft-type='table'] th {
                                            background: #EBEBEB;
                                            color: #121212;
                                            font-weight: 500;
                                        }

                                        .css-1g0fqss .video-box,
                                        .css-1g0fqss .link-box {
                                            position: relative;
                                            display: -webkit-box;
                                            display: -webkit-flex;
                                            display: -ms-flexbox;
                                            display: flex;
                                            -webkit-box-pack: justify;
                                            -webkit-justify-content: space-between;
                                            -ms-flex-pack: justify;
                                            justify-content: space-between;
                                            margin: 1.4em 0;
                                            overflow: auto;
                                            white-space: normal;
                                            cursor: pointer;
                                            border: solid 1px #EBEBEB;
                                            border-radius: 4px;
                                        }

                                        .css-1g0fqss .lazy[data-lazy-status] {
                                            background-color: #F6F6F6;
                                        }

                                        .css-1g0fqss .lazy[data-lazy-status="ok"] {
                                            background-color: transparent;
                                            -webkit-animation: animation-1yvu044 0.5s ease-in;
                                            animation: animation-1yvu044 0.5s ease-in;
                                        }

                                        .css-1g0fqss .highlight {
                                            margin: 1em 0;
                                        }

                                        .css-1g0fqss .highlight pre {
                                            margin: 0;
                                        }

                                        .css-1g0fqss .highlight .hll {
                                            background-color: #FDFDFD;
                                        }

                                        .css-1g0fqss .highlight .c {
                                            font-style: italic;
                                            color: #999999;
                                        }

                                        .css-1g0fqss .highlight .err {
                                            color: #F1403C;
                                        }

                                        .css-1g0fqss .highlight .k {
                                            font-weight: 600;
                                        }

                                        .css-1g0fqss .highlight .o {
                                            font-weight: 600;
                                        }

                                        .css-1g0fqss .highlight .cm {
                                            font-style: italic;
                                            color: #999999;
                                        }

                                        .css-1g0fqss .highlight .cp {
                                            font-weight: 600;
                                            color: #999999;
                                        }

                                        .css-1g0fqss .highlight .c1 {
                                            font-style: italic;
                                            color: #999999;
                                        }

                                        .css-1g0fqss .highlight .cs {
                                            font-style: italic;
                                            font-weight: 600;
                                            color: #999999;
                                        }

                                        .css-1g0fqss .highlight .gd {
                                            color: #FF3366;
                                        }

                                        .css-1g0fqss .highlight .ge {
                                            font-style: italic;
                                        }

                                        .css-1g0fqss .highlight .gr {
                                            color: #F1403C;
                                        }

                                        .css-1g0fqss .highlight .gh {
                                            color: #999999;
                                        }

                                        .css-1g0fqss .highlight .gi {
                                            color: #12b370;
                                        }

                                        .css-1g0fqss .highlight .go {
                                            color: #808080;
                                        }

                                        .css-1g0fqss .highlight .gp {
                                            color: #646464;
                                        }

                                        .css-1g0fqss .highlight .gs {
                                            font-weight: 600;
                                        }

                                        .css-1g0fqss .highlight .gu {
                                            color: #999999;
                                        }

                                        .css-1g0fqss .highlight .gt {
                                            color: #F1403C;
                                        }

                                        .css-1g0fqss .highlight .kc {
                                            font-weight: 600;
                                        }

                                        .css-1g0fqss .highlight .kd {
                                            font-weight: 600;
                                        }

                                        .css-1g0fqss .highlight .kn {
                                            font-weight: 600;
                                        }

                                        .css-1g0fqss .highlight .kp {
                                            font-weight: 600;
                                        }

                                        .css-1g0fqss .highlight .kr {
                                            font-weight: 600;
                                        }

                                        .css-1g0fqss .highlight .kt {
                                            font-weight: 600;
                                            color: #175199;
                                        }

                                        .css-1g0fqss .highlight .m {
                                            color: #056DE8;
                                        }

                                        .css-1g0fqss .highlight .s {
                                            color: #F1403C;
                                        }

                                        .css-1g0fqss .highlight .na {
                                            color: #056DE8;
                                        }

                                        .css-1g0fqss .highlight .nb {
                                            color: #056DE8;
                                        }

                                        .css-1g0fqss .highlight .nc {
                                            font-weight: 600;
                                            color: #175199;
                                        }

                                        .css-1g0fqss .highlight .no {
                                            color: #056DE8;
                                        }

                                        .css-1g0fqss .highlight .ni {
                                            color: #5555DD;
                                        }

                                        .css-1g0fqss .highlight .ne {
                                            font-weight: 600;
                                            color: #F1403C;
                                        }

                                        .css-1g0fqss .highlight .nf {
                                            font-weight: 600;
                                            color: #F1403C;
                                        }

                                        .css-1g0fqss .highlight .nn {
                                            color: #646464;
                                        }

                                        .css-1g0fqss .highlight .nt {
                                            color: #175199;
                                        }

                                        .css-1g0fqss .highlight .nv {
                                            color: #056DE8;
                                        }

                                        .css-1g0fqss .highlight .ow {
                                            font-weight: 600;
                                        }

                                        .css-1g0fqss .highlight .w {
                                            color: #BFBFBF;
                                        }

                                        .css-1g0fqss .highlight .mf {
                                            color: #056DE8;
                                        }

                                        .css-1g0fqss .highlight .mh {
                                            color: #056DE8;
                                        }

                                        .css-1g0fqss .highlight .mi {
                                            color: #056DE8;
                                        }

                                        .css-1g0fqss .highlight .mo {
                                            color: #056DE8;
                                        }

                                        .css-1g0fqss .highlight .sb {
                                            color: #F1403C;
                                        }

                                        .css-1g0fqss .highlight .sc {
                                            color: #F1403C;
                                        }

                                        .css-1g0fqss .highlight .sd {
                                            color: #F1403C;
                                        }

                                        .css-1g0fqss .highlight .s2 {
                                            color: #F1403C;
                                        }

                                        .css-1g0fqss .highlight .se {
                                            color: #F1403C;
                                        }

                                        .css-1g0fqss .highlight .sh {
                                            color: #F1403C;
                                        }

                                        .css-1g0fqss .highlight .si {
                                            color: #F1403C;
                                        }

                                        .css-1g0fqss .highlight .sx {
                                            color: #F1403C;
                                        }

                                        .css-1g0fqss .highlight .sr {
                                            color: #A5542F;
                                        }

                                        .css-1g0fqss .highlight .s1 {
                                            color: #F1403C;
                                        }

                                        .css-1g0fqss .highlight .ss {
                                            color: #F1403C;
                                        }

                                        .css-1g0fqss .highlight .bp {
                                            color: #999999;
                                        }

                                        .css-1g0fqss .highlight .vc {
                                            color: #056DE8;
                                        }

                                        .css-1g0fqss .highlight .vg {
                                            color: #056DE8;
                                        }

                                        .css-1g0fqss .highlight .vi {
                                            color: #056DE8;
                                        }

                                        .css-1g0fqss .highlight .il {
                                            color: #056DE8;
                                        }

                                        .css-1g0fqss .highlight::-webkit-scrollbar {
                                            width: 6px;
                                            height: 6px;
                                        }

                                        .css-1g0fqss .highlight::-webkit-scrollbar-thumb:horizontal {
                                            background-color: rgba(18, 18, 18, 0.5);
                                            border-radius: 6px;
                                        }

                                        .css-1g0fqss .highlight::-webkit-scrollbar-thumb:horizontal:hover {
                                            background-color: rgba(18, 18, 18, 0.6);
                                        }

                                        .css-1g0fqss .LinkCard.old {
                                            position: relative;
                                            display: block;
                                            margin: 1em auto;
                                            width: 390px;
                                            box-sizing: border-box;
                                            border-radius: 12px;
                                            max-width: 100%;
                                            overflow: hidden;
                                        }

                                        .css-1g0fqss .LinkCard.old,
                                        .css-1g0fqss .LinkCard.old:hover {
                                            -webkit-text-decoration: none;
                                            text-decoration: none;
                                            border: none !important;
                                            color: inherit !important;
                                        }

                                        .css-1g0fqss .LinkCard-ecommerceLoadingCard {
                                            position: relative;
                                            display: -webkit-box;
                                            display: -webkit-flex;
                                            display: -ms-flexbox;
                                            display: flex;
                                            -webkit-align-items: center;
                                            -webkit-box-align: center;
                                            -ms-flex-align: center;
                                            align-items: center;
                                            -webkit-box-pack: justify;
                                            -webkit-justify-content: space-between;
                                            -ms-flex-pack: justify;
                                            justify-content: space-between;
                                            padding: 12px;
                                            border-radius: inherit;
                                            height: 80px;
                                            box-sizing: border-box;
                                            background: rgba(246, 246, 246, 0.88);
                                            color: #D3D3D3;
                                        }

                                        .css-1g0fqss .LinkCard-ecommerceLoadingCardAvatarWrapper {
                                            width: 60px;
                                            height: 60px;
                                            background: #EBEBEB;
                                            display: -webkit-box;
                                            display: -webkit-flex;
                                            display: -ms-flexbox;
                                            display: flex;
                                            -webkit-align-items: center;
                                            -webkit-box-align: center;
                                            -ms-flex-align: center;
                                            align-items: center;
                                            -webkit-box-pack: center;
                                            -webkit-justify-content: center;
                                            -ms-flex-pack: center;
                                            justify-content: center;
                                            border-radius: 6px;
                                            margin-right: 10px;
                                        }

                                        .css-1g0fqss .LinkCard-ecommerceLoadingCardNetwork {
                                            width: 20px;
                                            height: 20px;
                                        }

                                        .css-1g0fqss .LinkCard-ecommerceLoadingCardLoadingbar {
                                            height: 60px;
                                            -webkit-flex: 1;
                                            -ms-flex: 1;
                                            flex: 1;
                                            display: -webkit-box;
                                            display: -webkit-flex;
                                            display: -ms-flexbox;
                                            display: flex;
                                            -webkit-flex-direction: column;
                                            -ms-flex-direction: column;
                                            flex-direction: column;
                                        }

                                        .css-1g0fqss .LinkCard-ecommerceLoadingCardLoadingbar span {
                                            height: 16px;
                                            display: inline-block;
                                            background: #EBEBEB;
                                        }

                                        .css-1g0fqss .LinkCard-ecommerceLoadingCardLoadingbar span:nth-of-type(1) {
                                            width: 60px;
                                            margin-bottom: 4px;
                                        }

                                        .css-1g0fqss .LinkCard-ecommerceLoadingCardLoadingbar span:nth-of-type(2) {
                                            width: 127px;
                                        }

                                        .css-1g0fqss .LinkCard.new {
                                            position: relative;
                                            display: -webkit-box;
                                            display: -webkit-flex;
                                            display: -ms-flexbox;
                                            display: flex;
                                            box-sizing: border-box;
                                            -webkit-flex-direction: row;
                                            -ms-flex-direction: row;
                                            flex-direction: row;
                                            -webkit-align-items: center;
                                            -webkit-box-align: center;
                                            -ms-flex-align: center;
                                            align-items: center;
                                            width: 390px;
                                            min-height: 84px;
                                            border-radius: 8px;
                                            max-width: 100%;
                                            overflow: hidden;
                                            margin: 16px auto;
                                            padding: 12px 12px 9px 12px;
                                            background-color: #F6F6F6;
                                        }

                                        .css-1g0fqss .LinkCard.new,
                                        .css-1g0fqss .LinkCard.new:hover {
                                            -webkit-text-decoration: none;
                                            text-decoration: none;
                                            border: none !important;
                                            color: inherit !important;
                                        }

                                        .css-1g0fqss .LinkCard.new .LinkCard-contents {
                                            display: block;
                                            -webkit-flex: 1 1 auto;
                                            -ms-flex: 1 1 auto;
                                            flex: 1 1 auto;
                                            position: relative;
                                        }

                                        .css-1g0fqss .LinkCard.new .LinkCard-contents .loading {
                                            height: 14px;
                                            background: #EBEBEB;
                                            border-radius: 7px;
                                        }

                                        .css-1g0fqss .LinkCard.new .LinkCard-contents.withTitle {
                                            margin-bottom: 3px;
                                        }

                                        .css-1g0fqss .LinkCard.new .LinkCard-title {
                                            display: -webkit-box;
                                            font-size: 15px;
                                            font-weight: 500;
                                            line-height: 1.4;
                                            margin-bottom: 2px;
                                            color: #121212;
                                            text-overflow: ellipsis;
                                            overflow: hidden;
                                            -webkit-box-orient: vertical;
                                            -webkit-line-clamp: 1;
                                        }

                                        .css-1g0fqss .LinkCard.new .LinkCard-title.two-line {
                                            line-height: 20px;
                                            display: -webkit-box;
                                            text-overflow: ellipsis;
                                            overflow: hidden;
                                            -webkit-box-orient: vertical;
                                            -webkit-line-clamp: 2;
                                        }

                                        .css-1g0fqss .LinkCard.new .LinkCard-title.loading {
                                            margin-bottom: 8px;
                                            width: 80%;
                                        }

                                        .css-1g0fqss .LinkCard.new .LinkCard-title.loading.withTitle {
                                            margin-bottom: 6px;
                                        }

                                        .css-1g0fqss .LinkCard.new .LinkCard-title.loadingTitle {
                                            margin-bottom: 5px;
                                        }

                                        .css-1g0fqss .LinkCard.new .LinkCard-excerpt {
                                            display: -webkit-box;
                                            text-overflow: ellipsis;
                                            font-size: 13px;
                                            line-height: 18px;
                                            color: #999999;
                                            margin-bottom: 4px;
                                            overflow: hidden;
                                            -webkit-box-orient: vertical;
                                            -webkit-line-clamp: 1;
                                        }

                                        .css-1g0fqss .LinkCard.new .LinkCard-excerpt .LinkCard-author {
                                            color: #444444;
                                        }

                                        .css-1g0fqss .LinkCard.new .LinkCard-desc {
                                            display: -webkit-box;
                                            font-size: 13px;
                                            height: 18px;
                                            line-height: 18px;
                                            color: #999999;
                                            word-break: break-all;
                                            text-overflow: ellipsis;
                                            overflow: hidden;
                                            -webkit-box-orient: vertical;
                                            -webkit-line-clamp: 1;
                                        }

                                        .css-1g0fqss .LinkCard.new .LinkCard-desc .LinkCard-tag,
                                        .css-1g0fqss .LinkCard.new .LinkCard-desc .tag {
                                            display: inline-block;
                                            font-size: 11px;
                                            margin-left: 8px;
                                            padding: 0 4px;
                                            border-radius: 3px;
                                            background: rgba(211, 211, 211, 0.3);
                                        }

                                        .css-1g0fqss .LinkCard.new .LinkCard-desc.loading {
                                            width: 40%;
                                        }

                                        .css-1g0fqss .LinkCard.new .LinkCard-desc svg {
                                            margin-right: 2px;
                                        }

                                        .css-1g0fqss .LinkCard.new .LinkCard-image {
                                            -webkit-flex: 0 0 auto;
                                            -ms-flex: 0 0 auto;
                                            flex: 0 0 auto;
                                            background-color: #EBEBEB;
                                            background-size: cover;
                                            background-position: center;
                                            position: relative;
                                            display: block;
                                            width: 60px;
                                            height: 60px;
                                            margin-left: 20px;
                                            object-fit: cover;
                                            border-radius: inherit;
                                            overflow: hidden;
                                        }

                                        .css-1g0fqss .LinkCard.new .LinkCard-image.LinkCard-image--default {
                                            display: -webkit-box;
                                            display: -webkit-flex;
                                            display: -ms-flexbox;
                                            display: flex;
                                            -webkit-align-items: center;
                                            -webkit-box-align: center;
                                            -ms-flex-align: center;
                                            align-items: center;
                                            -webkit-box-pack: center;
                                            -webkit-justify-content: center;
                                            -ms-flex-pack: center;
                                            justify-content: center;
                                            background-color: #EBEBEB;
                                            color: #D3D3D3;
                                        }

                                        .css-1g0fqss .LinkCard.new .LinkCard-image.LinkCard-image--default svg {
                                            color: #999999;
                                        }

                                        .css-1g0fqss .LinkCard.new .LinkCard-image img {
                                            width: 100%;
                                            height: 100%;
                                            object-fit: cover;
                                        }

                                        .css-1g0fqss .LinkCard.new .LinkCard-image .LinkCard-image--video {
                                            display: -webkit-box;
                                            display: -webkit-flex;
                                            display: -ms-flexbox;
                                            display: flex;
                                            -webkit-align-items: center;
                                            -webkit-box-align: center;
                                            -ms-flex-align: center;
                                            align-items: center;
                                            -webkit-box-pack: center;
                                            -webkit-justify-content: center;
                                            -ms-flex-pack: center;
                                            justify-content: center;
                                            position: absolute;
                                            top: 50%;
                                            left: 50%;
                                            -webkit-transform: translateX(-50%) translateY(-50%);
                                            -ms-transform: translateX(-50%) translateY(-50%);
                                            transform: translateX(-50%) translateY(-50%);
                                            width: 24px;
                                            height: 24px;
                                            border-radius: 12px;
                                            background: rgba(255, 255, 255, 0.9);
                                            pointer-events: none;
                                        }

                                        .css-1g0fqss .LinkCard.new .LinkCard-image .LinkCard-image--video svg {
                                            color: #444444;
                                        }

                                        .css-1g0fqss .LinkCard.new .LinkCard-richText .text {
                                            color: #444444;
                                        }

                                        .css-1g0fqss .LinkCard.new .LinkCard-richText .bold {
                                            font-weight: 600;
                                        }

                                        .css-1g0fqss .LinkCard.new .LinkCard-richText .tag {
                                            margin-left: 4px;
                                        }

                                        .css-1g0fqss .FileLinkCard {
                                            -webkit-align-items: center;
                                            -webkit-box-align: center;
                                            -ms-flex-align: center;
                                            align-items: center;
                                            background-color: rgba(246, 246, 246, 0.88);
                                            border-radius: 12px;
                                            box-sizing: border-box;
                                            display: -webkit-box;
                                            display: -webkit-flex;
                                            display: -ms-flexbox;
                                            display: flex;
                                            margin: 1em auto;
                                            max-width: 100%;
                                            overflow: hidden;
                                            padding: 12px;
                                            position: relative;
                                            width: 390px;
                                        }

                                        .css-1g0fqss .FileLinkCard-icon {
                                            -webkit-flex-shrink: 0;
                                            -ms-flex-negative: 0;
                                            flex-shrink: 0;
                                            height: 30px;
                                            width: 30px;
                                        }

                                        .css-1g0fqss .FileLinkCard-info {
                                            margin-left: 12px;
                                        }

                                        .css-1g0fqss .FileLinkCard-name {
                                            color: #121212;
                                            font-size: 15px;
                                            font-weight: 500;
                                            line-height: 21px;
                                            display: -webkit-box;
                                            text-overflow: ellipsis;
                                            overflow: hidden;
                                            -webkit-box-orient: vertical;
                                            -webkit-line-clamp: 2;
                                        }

                                        .css-1g0fqss .FileLinkCard-meta {
                                            color: #999999;
                                            font-size: 12px;
                                            display: -webkit-box;
                                            display: -webkit-flex;
                                            display: -ms-flexbox;
                                            display: flex;
                                            line-height: 14px;
                                            margin-top: 5px;
                                        }

                                        .css-1g0fqss .FileLinkCard-source {
                                            white-space: pre;
                                        }

                                        .css-1g0fqss img[data-uncomfortable] {
                                            content: url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20344.88888888888886%20194%22%3E%3CforeignObject%20width%3D%22344.88888888888886%22%20height%3D%22194%22%3E%0A%20%20%20%20%20%20%3Cdiv%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%22%20style%3D%22font-size%3A%2013px%3B%20font-family%3A%20-apple-system%2C%20BlinkMacSystemFont%2C%20Microsoft%20YaHei%2C%20sans-serif%3B%20color%3A%20%23fff%3B%20width%3A100%25%3B%20height%3A194px%3B%22%3E%0A%20%20%20%20%20%20%20%20%3Cdiv%20style%3D%22display%3A%20flex%3B%20flex-direction%3A%20column%3B%20align-items%3A%20center%3B%20justify-content%3A%20center%3B%20height%3A%20100%25%3B%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2218%22%20height%3D%2218%22%20viewBox%3D%220%200%2016%2016%22%20fill%3D%22currentColor%22%3E%3Cpath%20d%3D%22M8%203.65a7%207%200%2000-1.353.128.65.65%200%2011-.25-1.275A8.3%208.3%200%20018%202.35c2.387%200%204.172.954%205.357%202.125C14.511%205.615%2015.15%207.022%2015.15%208c0%20.621-.257%201.391-.699%202.134a7.076%207.076%200%2001-1.403%201.68l.495.46a.65.65%200%2011-.886.951l-.998-.929a.645.645%200%2001-.104-.097L9.73%2010.501a.647.647%200%2001-.29.301%203.15%203.15%200%2001-4.313-4.094.647.647%200%2001.234-.275L3.908%205.08a5.774%205.774%200%2000-1.283%201.522C2.282%207.198%202.15%207.707%202.15%208c0%20.522.41%201.616%201.407%202.6.965.954%202.43%201.75%204.443%201.75.468%200%20.905-.043%201.311-.12a.65.65%200%2001.243%201.277A8.322%208.322%200%20018%2013.65c-2.387%200-4.172-.954-5.357-2.125C1.49%2010.385.85%208.978.85%208c0-.598.238-1.333.648-2.046A7.054%207.054%200%20012.95%204.188l-.547-.509a.65.65%200%2011.886-.951l8.8%208.194a5.793%205.793%200%20001.244-1.453c.372-.624.516-1.163.516-1.469%200-.522-.41-1.616-1.407-2.6-.965-.954-2.43-1.75-4.443-1.75zM6.29%207.296a1.85%201.85%200%20002.534%202.36l-2.535-2.36zM8%204.85a.65.65%200%20100%201.3%201.85%201.85%200%20011.843%201.694.65.65%200%20101.296-.11A3.15%203.15%200%20008%204.85z%22%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E%0A%20%20%20%20%20%20%20%20%20%20%3Cdiv%20style%3D%22margin%3A%20.6em%200%201.2em%22%3E%E8%AF%A5%E5%9B%BE%E7%89%87%E6%9C%89%E5%8F%AF%E8%83%BD%E4%BC%9A%E5%BC%95%E8%B5%B7%E4%B8%8D%E9%80%82%3C%2Fdiv%3E%0A%20%20%20%20%20%20%20%20%20%20%3Cbutton%20style%3D%22padding%3A%204px%201em%3B%20font-size%3A%201.1em%3B%20color%3A%20inherit%3B%20background%3A%20none%3B%20border%3A%201px%20solid%20rgba%28255%2C255%2C255%2C.5%29%3B%20border-radius%3A%209999px%3B%22%3E%E7%BB%A7%E7%BB%AD%E6%9F%A5%E7%9C%8B%3C%2Fbutton%3E%0A%20%20%20%20%20%20%20%20%3C%2Fdiv%3E%0A%20%20%20%20%20%20%3C%2Fdiv%3E%0A%20%20%20%20%3C%2FforeignObject%3E%3C%2Fsvg%3E);
                                            width: 100%;
                                            height: 194px;
                                            background: url(https://pic1.zhimg.com/v2-cf70d0759d787c70091857151c1cad4a.jpeg) no-repeat rgba(191, 191, 191, 0.7);
                                            background-size: cover;
                                            cursor: pointer !important;
                                        }

                                        @-webkit-keyframes animation-1yvu044 {
                                            from {
                                                opacity: 0;
                                            }

                                            to {
                                                opacity: 1;
                                            }
                                        }

                                        @keyframes animation-1yvu044 {
                                            from {
                                                opacity: 0;
                                            }

                                            to {
                                                opacity: 1;
                                            }
                                        }
                                    </style>
                                    <div class="RichText ztext Post-RichText css-1g0fqss" options="[object Object]">
                                        <p data-first-child data-pid="birzT6EF">在前文<a
                                                href="https://zhuanlan.zhihu.com/p/65453337"
                                                class="internal">支持向量机原理详解(五): KKT条件(Part
                                                II)</a>中，我们推导了非线性SVM对偶问题的KKT条件。在此基础上，本文介绍用于训练SVM的序列最小最优化算法，内容如下：</p>
                                        <ul>
                                            <li data-pid="q9Juz2__">SMO算法的停机条件</li>
                                            <li data-pid="VX3Aquas">SMO算法的思路</li>
                                            <li data-pid="QIUT5Mvx">解析求解两个变量的二次规划子问题</li>
                                            <li data-pid="8xyEQP4r">选择优化变量的启发式方法(Heuristics)</li>
                                            <li data-pid="igAFI3D-">在精度 <span class="ztext-math" data-eeimg="1"
                                                    data-tex="\varepsilon">\varepsilon</span> 内检查KKT条件的方法</li>
                                        </ul>
                                        <h2>10. 序列最小最优化(<a
                                                href="https://link.zhihu.com/?target=https%3A//en.wikipedia.org/wiki/Sequential_minimal_optimization"
                                                class=" wrap external" target="_blank"
                                                rel="nofollow noreferrer">sequential minimal optimization, SMO</a>)算法
                                        </h2>
                                        <p data-pid="mKFZCL7x">
                                            序列最小最优化(SMO)算法于1998年由Platt提出(参考文献[1]，以下称<b>Platt1998</b>)。1999年的另一版本(参考文献[2]，以下称<b>Platt1999</b>)在Platt1998的基础上有少许修改。两篇文章的内容相互补充，可结合起来看。
                                        </p>
                                        <p data-pid="t1bODMs6">当数据集较大时，训练SVM需要求解一个大规模的<b>二次规划(quadratic programming,
                                                QP)</b>问题。SMO算法的大致思路是：将这个大的QP问题分解成一系列尽可能小的QP子问题(sub-problems)；然后在内层循环中，对这些小的QP问题进行解析求解，而不是数值优化，从而减少计算时间。
                                        </p>
                                        <h2>10.1 SMO算法的停机条件</h2>
                                        <p data-pid="994N7tF0">训练SVM需要求解的QP问题即前文推导的对偶问题：</p>
                                        <p data-pid="aPbHzHhK"><span class="ztext-math" data-eeimg="1"
                                                data-tex="\begin{align} \min_{\mathbf \alpha}{\frac{1}{2}\sum_{i=1}^{N}{\sum_{j=1}^{N}{y_iy_jk\left( \mathbf{x_i}, \mathbf{x_j} \right)\alpha_i\alpha_j}} -\sum_{j=1}^{N}{\alpha_i}}\\   s.t. \ \ \ \ \ \ \ \ \ \ \ \ \ 0 \leq \alpha_i \leq C, \ i=1,\ldots,N \ \ \ \ \ \ \ \ \ \\  \sum_{i=1}^{N}{y_i \alpha_i} = 0 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \\ \end{align}\tag{I}">\begin{align}
                                                \min_{\mathbf
                                                \alpha}{\frac{1}{2}\sum_{i=1}^{N}{\sum_{j=1}^{N}{y_iy_jk\left(
                                                \mathbf{x_i}, \mathbf{x_j} \right)\alpha_i\alpha_j}}
                                                -\sum_{j=1}^{N}{\alpha_i}}\\ s.t. \ \ \ \ \ \ \ \ \ \ \ \ \ 0 \leq
                                                \alpha_i \leq C, \ i=1,\ldots,N \ \ \ \ \ \ \ \ \ \\ \sum_{i=1}^{N}{y_i
                                                \alpha_i} = 0 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
                                                \ \ \ \ \ \\ \end{align}\tag{I}</span></p>
                                        <p data-pid="9MwyznHr">其中， <span class="ztext-math" data-eeimg="1"
                                                data-tex="N">N</span> 为训练集的样本数。为使这个QP问题为凸优化问题， <span class="ztext-math"
                                                data-eeimg="1" data-tex="k">k</span> 应为正定核。</p>
                                        <p data-pid="Mw7r84Dp">为方便起见，以下简记 <span class="ztext-math" data-eeimg="1"
                                                data-tex="k\left( \mathbf{x_i}, \mathbf{x_j} \right) = k_{ij}">k\left(
                                                \mathbf{x_i}, \mathbf{x_j} \right) = k_{ij}</span> 。</p>
                                        <p data-pid="dgrw_gFl">前文推导了问题 <span class="ztext-math" data-eeimg="1"
                                                data-tex="\left( \rm I \right)">\left( \rm I \right)</span>
                                            的KKT条件，也就是其最优解的充要条件。然而，我们希望求解的是优化变量 <span class="ztext-math" data-eeimg="1"
                                                data-tex="\alpha">\alpha</span> ，至于不等式约束的拉格朗日乘子 <span class="ztext-math"
                                                data-eeimg="1" data-tex="\lambda,\mu">\lambda,\mu</span>
                                            ，似乎不太重要。所以在KKT条件的基础上继续推导，得到了如下的条件：</p>
                                        <p data-pid="8SNymXqc"><span class="ztext-math" data-eeimg="1"
                                                data-tex="\begin{align} \alpha_i = 0 \ &amp;\Rightarrow \ y_id_i\geq 1\\ 0&lt; \alpha_i &lt; C \ &amp;\Rightarrow \ y_id_i = 1\\ \alpha_i = C \ &amp;\Rightarrow \ y_id_i\leq 1\\ \end{align}\\ \tag{II} ">\begin{align}
                                                \alpha_i = 0 \ &amp;\Rightarrow \ y_id_i\geq 1\\ 0&lt; \alpha_i &lt; C \
                                                &amp;\Rightarrow \ y_id_i = 1\\ \alpha_i = C \ &amp;\Rightarrow \
                                                y_id_i\leq 1\\ \end{align}\\ \tag{II} </span> </p>
                                        <p data-pid="B0AGdXi_">其中 <span class="ztext-math" data-eeimg="1"
                                                data-tex="d_i=\sum_{j=1}^{N}{y_j \alpha_j k_{ji}} + b">d_i=\sum_{j=1}^{N}{y_j
                                                \alpha_j k_{ji}} + b</span>。这里用 <span class="ztext-math" data-eeimg="1"
                                                data-tex="b">b</span> 表示等式约束的拉格朗日乘子，称为阈值(threshold)。</p>
                                        <p data-pid="wYyjboi5"><b>&lt;关于条件 <span class="ztext-math" data-eeimg="1"
                                                    data-tex="\left( \rm II \right)">\left( \rm II \right)</span>
                                                &gt;</b></p>
                                        <ul>
                                            <li data-pid="UsbjJTdT">在条件 <span class="ztext-math" data-eeimg="1"
                                                    data-tex="\left( \rm II \right)">\left( \rm II \right)</span>
                                                中，Platt1998里使用的是等价符号 <span class="ztext-math" data-eeimg="1"
                                                    data-tex="\Leftrightarrow">\Leftrightarrow</span> ，而Platt1999里使用的是
                                                <span class="ztext-math" data-eeimg="1"
                                                    data-tex="\Rightarrow">\Rightarrow</span> ；两篇文章都没有给出推导过程；</li>
                                            <li data-pid="Ln43xj7a">事实上，参考文献[5](Osuna1997)里有推导，但使用的是 <span
                                                    class="ztext-math" data-eeimg="1"
                                                    data-tex="\Rightarrow">\Rightarrow</span> ；</li>
                                            <li data-pid="ET1HIfhk">前文中反向的推导可能不太准确。</li>
                                        </ul>
                                        <p data-pid="-WopvRAz">如果对 <span class="ztext-math" data-eeimg="1"
                                                data-tex="i=1,\ldots, N">i=1,\ldots, N</span> 都满足条件 <span
                                                class="ztext-math" data-eeimg="1"
                                                data-tex="\left( \rm II \right)">\left( \rm II \right)</span> ，那么就得到了问题
                                            <span class="ztext-math" data-eeimg="1"
                                                data-tex="\left( \rm I \right)">\left( \rm I \right)</span>
                                            的最优解(Platt1999)。换句话说，条件 <span class="ztext-math" data-eeimg="1"
                                                data-tex="\left( \rm II \right)">\left( \rm II \right)</span>
                                            是SMO算法的停机条件(之一)。</p>
                                        <p data-pid="VhbKhifx">文献[3]和[4]将SMO算法的停机条件完整地表述为：</p>
                                        <p data-pid="hU6CW4Wl"><span class="ztext-math" data-eeimg="1"
                                                data-tex="\begin{align}  &amp;(i) \ \ \ \ \ \ 0\leq \alpha_i \leq C, \ i=1, \ldots, N \\ &amp;(ii) \ \ \ \ \sum_{i=1}^{N}{y_i\alpha_i}=0 \\  &amp;(iii) \ \ \ \ y_id_i \left\{  \begin{array}\\ \geq 1, \ \left\{ (\mathbf x_i,y_i)\vert \ \alpha_i=0 \right\}\\  =1, \ \left\{ (\mathbf x_i,y_i)\vert \ 0&lt; \alpha_i &lt; C \right\}\\  \leq 1, \ \left\{ (\mathbf x_i,y_i)\vert \ \alpha_i=C \right\}\\  \end{array} \right. \end{align}\\ \tag{III} ">\begin{align}
                                                &amp;(i) \ \ \ \ \ \ 0\leq \alpha_i \leq C, \ i=1, \ldots, N \\
                                                &amp;(ii) \ \ \ \ \sum_{i=1}^{N}{y_i\alpha_i}=0 \\ &amp;(iii) \ \ \ \
                                                y_id_i \left\{ \begin{array}\\ \geq 1, \ \left\{ (\mathbf x_i,y_i)\vert
                                                \ \alpha_i=0 \right\}\\ =1, \ \left\{ (\mathbf x_i,y_i)\vert \ 0&lt;
                                                \alpha_i &lt; C \right\}\\ \leq 1, \ \left\{ (\mathbf x_i,y_i)\vert \
                                                \alpha_i=C \right\}\\ \end{array} \right. \end{align}\\ \tag{III}
                                            </span> </p>
                                        <p data-pid="2GGfTMGn">不难理解，停机条件 <span class="ztext-math" data-eeimg="1"
                                                data-tex="\left( \rm III \right)">\left( \rm III \right)</span> 是根据问题
                                            <span class="ztext-math" data-eeimg="1"
                                                data-tex="\left( \rm I \right)">\left( \rm I \right)</span> 的KKT条件得到的。
                                        </p>
                                        <h2>10.2 SMO算法的思路</h2>
                                        <p data-pid="IvPFcbSi">如果训练集中的所有样本都满足停机条件 <span class="ztext-math"
                                                data-eeimg="1" data-tex="\left( \rm III \right)">\left( \rm III
                                                \right)</span> ，那么就得到了问题的最优解。</p>
                                        <p data-pid="3wVBplxQ">问题 <span class="ztext-math" data-eeimg="1"
                                                data-tex="\left( \rm I \right)">\left( \rm I \right)</span> 有 <span
                                                class="ztext-math" data-eeimg="1" data-tex="N">N</span>
                                            个优化变量，SMO将这个大的QP问题分解成一系列尽可能小的QP子问题——只包含两个变量的QP问题。然后在内层循环中，对这些小的QP问题进行解析求解，而不是数值优化，从而节省了时间。
                                        </p>
                                        <p data-pid="Z530Nfh9">由于要满足条件 <span class="ztext-math" data-eeimg="1"
                                                data-tex="\left( ii \right)">\left( ii \right)</span>
                                            ，最小的子问题包含两个变量：如果每步只优化一个变量，会违反这个等式约束；如果每次选择两个变量进行优化，那么就可以在先优化其中一个变量的同时，对另一个变量(根据等式约束)进行相应的调整，从而保证等式约束的成立。
                                        </p>
                                        <p data-pid="goUEOQtL">
                                            SMO完全避免了数值优化，尽管需要求解更多的子问题，但是每个子问题的解析求解非常快，所以整个QP问题的求解也非常快。</p>
                                        <p data-pid="XRmjwVee"><b>&lt;关于SMO的收敛性(Platt1998)&gt;</b></p>
                                        <p data-pid="eG5eNIuX">
                                            SMO算法的收敛性是由Osuna的理论(Osuna1997)保证的。Osuna的理论表明，一个大的QP问题可以分解成一系列较小的QP子问题进行求解。只要每一步的子问题(相对于前一步的子问题)都增加了至少一个违反KKT条件的样本，那么每一步的优化都会得到使目标函数值减小的可行解，进而保证算法最终收敛。
                                        </p>
                                        <p data-pid="PLxdIuOh">
                                            SMO每一步选择两个变量进行优化，而其中至少有一个(在优化之前)违反KKT条件，所以根据Osuna的理论，每一步优化都会使目标函数值减小，从而保证了算法的收敛性。
                                        </p>
                                        <p data-pid="iy1ICevj">SMO包含两个部分：求解两个变量QP问题的解析方法，和选择优化变量的启发式方法。下面具体介绍。</p>
                                        <h2>10.3 解析求解两个变量的QP子问题</h2>
                                        <p data-pid="4hkdG0p3">下面推导求解包含两个变量的QP子问题的解析方法。</p>
                                        <p data-pid="bc9EKhYB">不失一般性，记这个子问题的两个变量为 <span class="ztext-math"
                                                data-eeimg="1" data-tex="\alpha_1, \ \alpha_2">\alpha_1, \
                                                \alpha_2</span> 。在优化这两个变量时，将其余 <span class="ztext-math" data-eeimg="1"
                                                data-tex="N-2">N-2</span> 个变量 <span class="ztext-math" data-eeimg="1"
                                                data-tex="\alpha_i, i=3,\ldots,N">\alpha_i, i=3,\ldots,N</span>
                                            当作常数，则目标函数</p>
                                        <p data-pid="f8NodsDq"><span class="ztext-math" data-eeimg="1"
                                                data-tex="\begin{align} \phi\left( \alpha_1, \alpha_2 \right) &amp;= \frac{1}{2}\sum_{i=1}^{N}{\sum_{j=1}^{N}{y_i y_j k_{ij}\alpha_i\alpha_j}}-\sum_{j=1}^{N}{\alpha_i} \\ &amp;=\frac{1}{2}y_1^2k_{11}\alpha_1^2+\frac{1}{2}y_2^2k_{22}\alpha_2^2 + y_1y_2k_{12}\alpha_1\alpha_2+c_1y_1\alpha_1+c_2y_2\alpha_2-\alpha_1-\alpha_2+Const\\ &amp;=\frac{1}{2}k_{11}\alpha_1^2+\frac{1}{2}k_{22}\alpha_2^2 + y_1y_2k_{12}\alpha_1\alpha_2+c_1y_1\alpha_1+c_2y_2\alpha_2-\alpha_1-\alpha_2+Const\\ \end{align}">\begin{align}
                                                \phi\left( \alpha_1, \alpha_2 \right) &amp;=
                                                \frac{1}{2}\sum_{i=1}^{N}{\sum_{j=1}^{N}{y_i y_j
                                                k_{ij}\alpha_i\alpha_j}}-\sum_{j=1}^{N}{\alpha_i} \\
                                                &amp;=\frac{1}{2}y_1^2k_{11}\alpha_1^2+\frac{1}{2}y_2^2k_{22}\alpha_2^2
                                                +
                                                y_1y_2k_{12}\alpha_1\alpha_2+c_1y_1\alpha_1+c_2y_2\alpha_2-\alpha_1-\alpha_2+Const\\
                                                &amp;=\frac{1}{2}k_{11}\alpha_1^2+\frac{1}{2}k_{22}\alpha_2^2 +
                                                y_1y_2k_{12}\alpha_1\alpha_2+c_1y_1\alpha_1+c_2y_2\alpha_2-\alpha_1-\alpha_2+Const\\
                                                \end{align}</span> </p>
                                        <p data-pid="jsuJuuNt">其中， <span class="ztext-math" data-eeimg="1"
                                                data-tex="Const">Const</span> 表示目标函数中与 <span class="ztext-math"
                                                data-eeimg="1" data-tex="\alpha_1, \ \alpha_2">\alpha_1, \
                                                \alpha_2</span> 均无关的项的和，因此在对 <span class="ztext-math" data-eeimg="1"
                                                data-tex="\alpha_1, \ \alpha_2">\alpha_1, \ \alpha_2</span>
                                            进行优化时是常数，可省略；</p>
                                        <p data-pid="qlQj0YyB">式中 <span class="ztext-math" data-eeimg="1"
                                                data-tex="c_1=\sum_{j=3}^{N}{y_jk_{1j}\alpha_j}, \ c_2=\sum_{j=3}^{N}{y_jk_{2j}\alpha_j}">c_1=\sum_{j=3}^{N}{y_jk_{1j}\alpha_j},
                                                \ c_2=\sum_{j=3}^{N}{y_jk_{2j}\alpha_j}</span> ；因为SMO是一种迭代的算法，这里 <span
                                                class="ztext-math" data-eeimg="1" data-tex="c_1, \ c_2">c_1, \
                                                c_2</span> 由上一次优化后的变量值(上标为 <span class="ztext-math" data-eeimg="1"
                                                data-tex="old">old</span> )来计算：</p>
                                        <p data-pid="UaDkIIpY"><span class="ztext-math" data-eeimg="1"
                                                data-tex="\begin{align}c_1=\sum_{j=3}^{N}{y_jk_{1j}\alpha_j^{old}}=d_1^{old}-b^{old}-y_1k_{11}\alpha_1^{old}-y_2k_{21}\alpha_2^{old} \\ \ c_2=\sum_{j=3}^{N}{y_jk_{2j}\alpha_j^{old}}=d_2^{old}-b^{old}-y_1k_{12}\alpha_1^{old}-y_2k_{22}\alpha_2^{old}\\ \end{align}\tag{1}">\begin{align}c_1=\sum_{j=3}^{N}{y_jk_{1j}\alpha_j^{old}}=d_1^{old}-b^{old}-y_1k_{11}\alpha_1^{old}-y_2k_{21}\alpha_2^{old}
                                                \\ \
                                                c_2=\sum_{j=3}^{N}{y_jk_{2j}\alpha_j^{old}}=d_2^{old}-b^{old}-y_1k_{12}\alpha_1^{old}-y_2k_{22}\alpha_2^{old}\\
                                                \end{align}\tag{1}</span> </p>
                                        <p data-pid="clBvMGce">所以两个变量的QP子问题如下：</p>
                                        <p data-pid="-DchYfEg"><span class="ztext-math" data-eeimg="1"
                                                data-tex="\begin{align} \min_{\alpha_1, \alpha_2}{\phi\left( \alpha_1, \alpha_2 \right)=\frac{1}{2}k_{11}\alpha_1^2+\frac{1}{2}k_{22}\alpha_2^2 + y_1y_2k_{12}\alpha_1\alpha_2+c_1y_1\alpha_1+c_2y_2\alpha_2-\alpha_1-\alpha_2}\\  s.t. \ \ \ \  0 \leq \alpha_1 \leq C \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \tag{2-1}\\  0 \leq \alpha_2 \leq C \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \tag{2-2}\\  y_1\alpha_1+y_2\alpha_2 = -\sum_{i=3}^{N}{y_i \alpha_i^{old}} = z \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \tag{2-3}\\ \end{align}\tag{IV}">\begin{align}
                                                \min_{\alpha_1, \alpha_2}{\phi\left( \alpha_1, \alpha_2
                                                \right)=\frac{1}{2}k_{11}\alpha_1^2+\frac{1}{2}k_{22}\alpha_2^2 +
                                                y_1y_2k_{12}\alpha_1\alpha_2+c_1y_1\alpha_1+c_2y_2\alpha_2-\alpha_1-\alpha_2}\\
                                                s.t. \ \ \ \ 0 \leq \alpha_1 \leq C \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
                                                \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \tag{2-1}\\
                                                0 \leq \alpha_2 \leq C \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
                                                \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \tag{2-2}\\
                                                y_1\alpha_1+y_2\alpha_2 = -\sum_{i=3}^{N}{y_i \alpha_i^{old}} = z \ \ \
                                                \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
                                                \ \ \ \ \ \ \ \ \ \ \tag{2-3}\\ \end{align}\tag{IV}</span> </p>
                                        <p data-pid="iGaM2vGJ">这里(2-3)式中， <span class="ztext-math" data-eeimg="1"
                                                data-tex="z">z</span> 用上一次优化后的变量值计算：</p>
                                        <p data-pid="2462p6He"><span class="ztext-math" data-eeimg="1"
                                                data-tex="z = -\sum_{i=3}^{N}{y_i \alpha_i^{old}}=y_1\alpha_1^{old}+y_2\alpha_2^{old}\\ \tag{3}">z
                                                = -\sum_{i=3}^{N}{y_i
                                                \alpha_i^{old}}=y_1\alpha_1^{old}+y_2\alpha_2^{old}\\ \tag{3}</span>
                                        </p>
                                        <p data-pid="W7aoSyzU">在SMO中，对于问题 <span class="ztext-math" data-eeimg="1"
                                                data-tex="\left( \rm IV \right)">\left( \rm IV \right)</span>
                                            采用这样一种解析解法：</p>
                                        <ul>
                                            <li data-pid="wrL1s6By">先用(2-3)式消掉 <span class="ztext-math" data-eeimg="1"
                                                    data-tex="\alpha_1">\alpha_1</span> ，然后当作只关于 <span
                                                    class="ztext-math" data-eeimg="1"
                                                    data-tex="\alpha_2">\alpha_2</span>
                                                的单变量无约束优化问题，通过导数为0的条件来求最小值点，得到(未修剪的)最优解 <span class="ztext-math"
                                                    data-eeimg="1"
                                                    data-tex="\alpha_2^{unclipped}">\alpha_2^{unclipped}</span> ；</li>
                                            <li data-pid="yN0-KLCJ">根据不等式约束(2-1)和(2-2)来修剪 <span class="ztext-math"
                                                    data-eeimg="1"
                                                    data-tex="\alpha_2^{unclipped}">\alpha_2^{unclipped}</span> ，得到
                                                <span class="ztext-math" data-eeimg="1"
                                                    data-tex="\alpha_2^{new}">\alpha_2^{new}</span> ；</li>
                                            <li data-pid="mq-YLQ7Z">再由 <span class="ztext-math" data-eeimg="1"
                                                    data-tex="\alpha_2^{new}">\alpha_2^{new}</span> 和(2-3)式计算 <span
                                                    class="ztext-math" data-eeimg="1"
                                                    data-tex="\alpha_1^{new}">\alpha_1^{new}</span> ，将 <span
                                                    class="ztext-math" data-eeimg="1"
                                                    data-tex="\alpha_1^{new}, \alpha_2^{new}">\alpha_1^{new},
                                                    \alpha_2^{new}</span> 作为问题 <span class="ztext-math" data-eeimg="1"
                                                    data-tex="\left( \rm IV \right)">\left( \rm IV \right)</span> 的最优解。
                                            </li>
                                        </ul>
                                        <p data-pid="A8XvAhBX">下面详细推导。</p>
                                        <h2><b>&lt;第1步：单变量的无约束优化&gt;</b></h2>
                                        <p data-pid="kst3oRE7">因 <span class="ztext-math" data-eeimg="1"
                                                data-tex="y_i^2=1">y_i^2=1</span> ，由(2-3)有 <span class="ztext-math"
                                                data-eeimg="1"
                                                data-tex="\alpha_1 = y_1\left( z - y_2\alpha_2 \right)">\alpha_1 =
                                                y_1\left( z - y_2\alpha_2 \right)</span> ，代入目标函数 <span
                                                class="ztext-math" data-eeimg="1"
                                                data-tex="\phi\left( \alpha_1, \alpha_2 \right)">\phi\left( \alpha_1,
                                                \alpha_2 \right)</span> 消掉 <span class="ztext-math" data-eeimg="1"
                                                data-tex="\alpha_1">\alpha_1</span> ，得到只关于 <span class="ztext-math"
                                                data-eeimg="1" data-tex="\alpha_2">\alpha_2</span> 的目标函数：</p>
                                        <p data-pid="3le9C0cU"><span class="ztext-math" data-eeimg="1"
                                                data-tex="\begin{align}\phi\left( \alpha_2 \right)=\frac{1}{2}k_{11}\left(z - y_2\alpha_2 \right)^2+\frac{1}{2}k_{22}\alpha_2^2 + y_2k_{12}\left(z - y_2\alpha_2 \right)\alpha_2\\+c_1\left(z - y_2\alpha_2 \right)+c_2y_2\alpha_2-y_1\left(z - y_2\alpha_2 \right)-\alpha_2\\ \end{align}\\">\begin{align}\phi\left(
                                                \alpha_2 \right)=\frac{1}{2}k_{11}\left(z - y_2\alpha_2
                                                \right)^2+\frac{1}{2}k_{22}\alpha_2^2 + y_2k_{12}\left(z - y_2\alpha_2
                                                \right)\alpha_2\\+c_1\left(z - y_2\alpha_2
                                                \right)+c_2y_2\alpha_2-y_1\left(z - y_2\alpha_2 \right)-\alpha_2\\
                                                \end{align}\\</span> </p>
                                        <p data-pid="q25WatwQ">因为 <span class="ztext-math" data-eeimg="1"
                                                data-tex="\phi\left( \alpha_2 \right)">\phi\left( \alpha_2
                                                \right)</span> 为一元二次函数，令导数为0得到其最小值点：</p>
                                        <p data-pid="0nz1vC_O"><span class="ztext-math" data-eeimg="1"
                                                data-tex="\begin{align} \frac{d\phi}{d\alpha_2} &amp;= -y_2k_{11}\left(z - y_2\alpha_2 \right)+k_{22}\alpha_2 + y_2k_{12}\left(z - 2y_2\alpha_2 \right)-c_1y_2+c_2y_2+y_1y_2-1\\ &amp;= \left( k_{11}+k_{22}-2k_{12} \right)\alpha_2-y_2k_{11}z+y_2k_{12}z-c_1y_2+c_2y_2+y_1y_2-1\\ \end{align}">\begin{align}
                                                \frac{d\phi}{d\alpha_2} &amp;= -y_2k_{11}\left(z - y_2\alpha_2
                                                \right)+k_{22}\alpha_2 + y_2k_{12}\left(z - 2y_2\alpha_2
                                                \right)-c_1y_2+c_2y_2+y_1y_2-1\\ &amp;= \left( k_{11}+k_{22}-2k_{12}
                                                \right)\alpha_2-y_2k_{11}z+y_2k_{12}z-c_1y_2+c_2y_2+y_1y_2-1\\
                                                \end{align}</span> </p>
                                        <p data-pid="NS5sZUFw">所以</p>
                                        <p data-pid="__kBCaHH"><span class="ztext-math" data-eeimg="1"
                                                data-tex="\begin{align} \frac{\partial\phi}{\partial\alpha_2}=0\Rightarrow  \left( k_{11}+k_{22}-2k_{12} \right)\alpha_2&amp;=y_2k_{11}z-y_2k_{12}z+c_1y_2-c_2y_2-y_1y_2+1\\  \Rightarrow\left( k_{11}+k_{22}-2k_{12} \right)\alpha_2&amp;=y_2\left( k_{11}z-k_{12}z+c_1-c_2-y_1+y_2 \right)\tag{4}\\ \end{align}">\begin{align}
                                                \frac{\partial\phi}{\partial\alpha_2}=0\Rightarrow \left(
                                                k_{11}+k_{22}-2k_{12}
                                                \right)\alpha_2&amp;=y_2k_{11}z-y_2k_{12}z+c_1y_2-c_2y_2-y_1y_2+1\\
                                                \Rightarrow\left( k_{11}+k_{22}-2k_{12} \right)\alpha_2&amp;=y_2\left(
                                                k_{11}z-k_{12}z+c_1-c_2-y_1+y_2 \right)\tag{4}\\ \end{align}</span> </p>
                                        <p data-pid="UO_f8i9x">在(4)式中，将 <span class="ztext-math" data-eeimg="1"
                                                data-tex="c_1, c_2, z">c_1, c_2, z</span> 分别用(1)(3)式代入得</p>
                                        <p data-pid="aRM9e9a6"><span class="ztext-math" data-eeimg="1"
                                                data-tex="\begin{align} \left( k_{11}+k_{22}-2k_{12} \right)\alpha_2 &amp;=y_2\left[ k_{11}\left( y_1\alpha_1^{old}+y_2\alpha_2^{old} \right)-k_{12}\left( y_1\alpha_1^{old}+y_2\alpha_2^{old} \right)\\ +\left( d_1^{old}-b^{old}-y_1k_{11}\alpha_1^{old}-y_2k_{12}\alpha_2^{old} \right)\\ \ \ \ \ \ \ \ \ \ -\left( d_2^{old}-b^{old}-y_1k_{12}\alpha_1^{old}-y_2k_{22}\alpha_2^{old} \right)-y_1+y_2 \right]\\ &amp;=y_2\left[ y_2k_{11}\alpha_2^{old}-2y_2k_{12}\alpha_2^{old}+y_2k_{22}\alpha_2^{old}+\left( d_1^{old}-y_1\right)-\left( d_2^{old}-y_2 \right)\right]\\ &amp;=\left( k_{11}+k_{22}-2k_{12} \right)\alpha_2^{old}+y_2\left(d_1^{old}-y_1\right)-y_2\left(d_2^{old}-y_2 \right)\tag{5}\\ \end{align}">\begin{align}
                                                \left( k_{11}+k_{22}-2k_{12} \right)\alpha_2 &amp;=y_2\left[
                                                k_{11}\left( y_1\alpha_1^{old}+y_2\alpha_2^{old} \right)-k_{12}\left(
                                                y_1\alpha_1^{old}+y_2\alpha_2^{old} \right)\\ +\left(
                                                d_1^{old}-b^{old}-y_1k_{11}\alpha_1^{old}-y_2k_{12}\alpha_2^{old}
                                                \right)\\ \ \ \ \ \ \ \ \ \ -\left(
                                                d_2^{old}-b^{old}-y_1k_{12}\alpha_1^{old}-y_2k_{22}\alpha_2^{old}
                                                \right)-y_1+y_2 \right]\\ &amp;=y_2\left[
                                                y_2k_{11}\alpha_2^{old}-2y_2k_{12}\alpha_2^{old}+y_2k_{22}\alpha_2^{old}+\left(
                                                d_1^{old}-y_1\right)-\left( d_2^{old}-y_2 \right)\right]\\ &amp;=\left(
                                                k_{11}+k_{22}-2k_{12}
                                                \right)\alpha_2^{old}+y_2\left(d_1^{old}-y_1\right)-y_2\left(d_2^{old}-y_2
                                                \right)\tag{5}\\ \end{align}</span> </p>
                                        <p data-pid="VErEhjrq">记 <span class="ztext-math" data-eeimg="1"
                                                data-tex="\eta = k_{11}+k_{22}-2k_{12}">\eta =
                                                k_{11}+k_{22}-2k_{12}</span> ， <span class="ztext-math" data-eeimg="1"
                                                data-tex="\eta">\eta</span> 一般为正；</p>
                                        <p data-pid="CA5VrKy-">记 <span class="ztext-math" data-eeimg="1"
                                                data-tex="E_i = d_i - y_i">E_i = d_i - y_i</span> 为第 <span
                                                class="ztext-math" data-eeimg="1" data-tex="i">i</span>
                                            个样本的差值(Platt使用的是&#39;error&#39;这个词)。注意这个&#39;error&#39;并不代表模型的精确度，只是算法中用到的一个差值；
                                            <span class="ztext-math" data-eeimg="1" data-tex="d_i">d_i</span> 类比 <span
                                                class="ztext-math" data-eeimg="1" data-tex="\mathbf {wx_i}+b">\mathbf
                                                {wx_i}+b</span> ，并不是分类决策函数 <span class="ztext-math" data-eeimg="1"
                                                data-tex="sign\left( \mathbf {wx_i}+b \right)">sign\left( \mathbf
                                                {wx_i}+b \right)</span> ，对正例来说 <span class="ztext-math" data-eeimg="1"
                                                data-tex="d_i">d_i</span> 可能大于等于1，负例则可能小于等于-1，间隔边界上等于 <span
                                                class="ztext-math" data-eeimg="1" data-tex="\pm 1">\pm 1</span> 。</p>
                                        <p data-pid="CQMWuF2J">则由(5)式得到(未修剪的)最优解为：</p>
                                        <p data-pid="gMZc1cwp"><span class="ztext-math" data-eeimg="1"
                                                data-tex="\begin{align} \alpha_2^{unclipped}=\alpha_2^{old}+\frac{y_2\left(E_1-E_2\right)}{\eta}\\ \end{align}\\ \tag{6}">\begin{align}
                                                \alpha_2^{unclipped}=\alpha_2^{old}+\frac{y_2\left(E_1-E_2\right)}{\eta}\\
                                                \end{align}\\ \tag{6}</span> </p>
                                        <p data-pid="FlodwN2P">[即使 <span class="ztext-math" data-eeimg="1"
                                                data-tex="\eta">\eta</span>
                                            不为正，SMO也能工作，具体处理方法见Platt1998，SMO会将变量移到目标函数值最小的端点上。这里就不做介绍了。]</p>
                                        <h2><b>&lt;第2步：修剪(clip)</b> <span class="ztext-math" data-eeimg="1"
                                                data-tex="\alpha_2^{unclipped}">\alpha_2^{unclipped}</span> <b>&gt;</b>
                                        </h2>
                                        <p data-pid="Uj2iBZb1">注意问题 <span class="ztext-math" data-eeimg="1"
                                                data-tex="\left( \rm IV \right)">\left( \rm IV \right)</span>
                                            的最优解还应满足不等式约束(2-1)(2-2)，所以由(6)式计算出的是未修剪的解。现在考虑不等式约束，由(2-1)~(2-3)，</p>
                                        <p data-pid="yK6v2KNv"><span class="ztext-math" data-eeimg="1"
                                                data-tex="\begin{align} &amp;y_1\alpha_1+y_2\alpha_2=y_1\alpha_1^{old}+y_2\alpha_2^{old}\\ &amp;\Rightarrow y_1\alpha_1 = y_1\alpha_1^{old}+y_2\left( \alpha_2^{old}-\alpha_2 \right)\\ &amp;\Rightarrow \alpha_1 = \alpha_1^{old}+y_1y_2\left( \alpha_2^{old}-\alpha_2 \right) \tag{7}\end{align}\\ ">\begin{align}
                                                &amp;y_1\alpha_1+y_2\alpha_2=y_1\alpha_1^{old}+y_2\alpha_2^{old}\\
                                                &amp;\Rightarrow y_1\alpha_1 = y_1\alpha_1^{old}+y_2\left(
                                                \alpha_2^{old}-\alpha_2 \right)\\ &amp;\Rightarrow \alpha_1 =
                                                \alpha_1^{old}+y_1y_2\left( \alpha_2^{old}-\alpha_2 \right)
                                                \tag{7}\end{align}\\ </span> </p>
                                        <ul>
                                            <li data-pid="9crsiGdj">当 <span class="ztext-math" data-eeimg="1"
                                                    data-tex="y_1=y_2">y_1=y_2</span> 时， <span class="ztext-math"
                                                    data-eeimg="1" data-tex="y_1y_2=1">y_1y_2=1</span> ，由(7)式有 <span
                                                    class="ztext-math" data-eeimg="1"
                                                    data-tex="\alpha_1=\alpha_1^{old}+\alpha_2^{old}-\alpha_2">\alpha_1=\alpha_1^{old}+\alpha_2^{old}-\alpha_2</span>
                                                ，所以</li>
                                        </ul>
                                        <p data-pid="froEqF6R"><span class="ztext-math" data-eeimg="1"
                                                data-tex="0\leq \alpha_1\leq C \Leftrightarrow \alpha_1^{old}+\alpha_2^{old}-C\leq \alpha_2\leq \alpha_1^{old}+\alpha_2^{old}\\">0\leq
                                                \alpha_1\leq C \Leftrightarrow \alpha_1^{old}+\alpha_2^{old}-C\leq
                                                \alpha_2\leq \alpha_1^{old}+\alpha_2^{old}\\</span> </p>
                                        <p data-pid="bVnh12xy">又 <span class="ztext-math" data-eeimg="1"
                                                data-tex="0\leq \alpha_2\leq C">0\leq \alpha_2\leq C</span> ，所以</p>
                                        <p data-pid="kzvKmFeT"><span class="ztext-math" data-eeimg="1"
                                                data-tex="\max\left(0, \ \alpha_1^{old}+\alpha_2^{old}-C \right) \leq \alpha_2\leq \min\left( C, \ \alpha_1^{old}+\alpha_2^{old} \right)\\ \tag{8}">\max\left(0,
                                                \ \alpha_1^{old}+\alpha_2^{old}-C \right) \leq \alpha_2\leq \min\left(
                                                C, \ \alpha_1^{old}+\alpha_2^{old} \right)\\ \tag{8}</span> </p>
                                        <ul>
                                            <li data-pid="6xVp_PG_">当 <span class="ztext-math" data-eeimg="1"
                                                    data-tex="y_1\ne y_2">y_1\ne y_2</span> 时， <span class="ztext-math"
                                                    data-eeimg="1" data-tex="y_1y_2=-1">y_1y_2=-1</span> ，由(7)式有 <span
                                                    class="ztext-math" data-eeimg="1"
                                                    data-tex="\alpha_1=\alpha_1^{old}-\alpha_2^{old}+\alpha_2">\alpha_1=\alpha_1^{old}-\alpha_2^{old}+\alpha_2</span>
                                                ，所以</li>
                                        </ul>
                                        <p data-pid="cQ836XaD"><span class="ztext-math" data-eeimg="1"
                                                data-tex="0\leq \alpha_1\leq C \Leftrightarrow \alpha_2^{old}-\alpha_1^{old}\leq \alpha_2\leq \alpha_2^{old}-\alpha_1^{old}+C\\">0\leq
                                                \alpha_1\leq C \Leftrightarrow \alpha_2^{old}-\alpha_1^{old}\leq
                                                \alpha_2\leq \alpha_2^{old}-\alpha_1^{old}+C\\</span> </p>
                                        <p data-pid="pJ98eysD">又 <span class="ztext-math" data-eeimg="1"
                                                data-tex="0\leq \alpha_2\leq C">0\leq \alpha_2\leq C</span> ，所以</p>
                                        <p data-pid="EWxDwPQw"><span class="ztext-math" data-eeimg="1"
                                                data-tex="\max\left(0, \ \alpha_2^{old}-\alpha_1^{old} \right) \leq \alpha_2\leq \min\left( C, \ \alpha_2^{old}-\alpha_1^{old}+C \right)\\ \tag{9}">\max\left(0,
                                                \ \alpha_2^{old}-\alpha_1^{old} \right) \leq \alpha_2\leq \min\left( C,
                                                \ \alpha_2^{old}-\alpha_1^{old}+C \right)\\ \tag{9}</span> </p>
                                        <p data-pid="rPBPhXnL">考虑到一元二次函数的特点(可结合一元二次函数的图像来看)，对 <span class="ztext-math"
                                                data-eeimg="1"
                                                data-tex="\alpha_2^{unclipped}">\alpha_2^{unclipped}</span> 做如下调整应该会得到问题
                                            <span class="ztext-math" data-eeimg="1"
                                                data-tex="\left( \rm IV \right)">\left( \rm IV \right)</span> 的最优解：</p>
                                        <p data-pid="cVkIzh25">当 <span class="ztext-math" data-eeimg="1"
                                                data-tex="\alpha_2^{unclipped}">\alpha_2^{unclipped}</span> 超过(8)或(9)的上限
                                            <span class="ztext-math" data-eeimg="1" data-tex="H">H</span> 时，取 <span
                                                class="ztext-math" data-eeimg="1"
                                                data-tex="\alpha_2^{new}=H">\alpha_2^{new}=H</span> 作为问题的解；当 <span
                                                class="ztext-math" data-eeimg="1"
                                                data-tex="\alpha_2^{unclipped}">\alpha_2^{unclipped}</span> 低于(8)或(9)的下限
                                            <span class="ztext-math" data-eeimg="1" data-tex="L">L</span> 时，取 <span
                                                class="ztext-math" data-eeimg="1"
                                                data-tex="\alpha_2^{new}=L">\alpha_2^{new}=L</span> 作为问题的解；若 <span
                                                class="ztext-math" data-eeimg="1"
                                                data-tex="\alpha_2^{unclipped}">\alpha_2^{unclipped}</span> 在上下限之间则不需调整。
                                        </p>
                                        <p data-pid="q294K_e8">整理得到对 <span class="ztext-math" data-eeimg="1"
                                                data-tex="\alpha_2^{unclipped}">\alpha_2^{unclipped}</span> 修剪方法为：</p>
                                        <p data-pid="9hG6JD6U"><span class="ztext-math" data-eeimg="1"
                                                data-tex="\alpha_2^{new}=\left\{  \begin{align}  H, \ \ \ &amp;if \ \ \ \alpha_2^{unclipped}\geq H \\  \alpha_2^{unclipped}, \ \ \ &amp;if \ \ \ L &lt;\alpha_2^{unclipped}&lt; H\\ L, \ \ \ &amp;if \ \ \ \alpha_2^{unclipped}\leq L \\  \end{align} \right.\\">\alpha_2^{new}=\left\{
                                                \begin{align} H, \ \ \ &amp;if \ \ \ \alpha_2^{unclipped}\geq H \\
                                                \alpha_2^{unclipped}, \ \ \ &amp;if \ \ \ L &lt;\alpha_2^{unclipped}&lt;
                                                H\\ L, \ \ \ &amp;if \ \ \ \alpha_2^{unclipped}\leq L \\ \end{align}
                                                \right.\\</span> </p>
                                        <p data-pid="dGpzFz6a">其中，当 <span class="ztext-math" data-eeimg="1"
                                                data-tex="y_1y_2=1">y_1y_2=1</span> 时， <span class="ztext-math"
                                                data-eeimg="1"
                                                data-tex="L=\max\left(0, \ \alpha_1^{old}+\alpha_2^{old}-C \right), \ H=\min\left( C, \ \alpha_1^{old}+\alpha_2^{old} \right)">L=\max\left(0,
                                                \ \alpha_1^{old}+\alpha_2^{old}-C \right), \ H=\min\left( C, \
                                                \alpha_1^{old}+\alpha_2^{old} \right)</span> ；</p>
                                        <p data-pid="8thJVPSJ">当 <span class="ztext-math" data-eeimg="1"
                                                data-tex="y_1y_2=-1">y_1y_2=-1</span> 时， <span class="ztext-math"
                                                data-eeimg="1"
                                                data-tex="L=\max\left(0, \ \alpha_2^{old}-\alpha_1^{old} \right), \ H=\min\left( C, \ \alpha_2^{old}-\alpha_1^{old}+C \right)">L=\max\left(0,
                                                \ \alpha_2^{old}-\alpha_1^{old} \right), \ H=\min\left( C, \
                                                \alpha_2^{old}-\alpha_1^{old}+C \right)</span> 。</p>
                                        <h2><b>&lt;第3步：计算 <span class="ztext-math" data-eeimg="1"
                                                    data-tex="\alpha_1^{new}">\alpha_1^{new}</span>&gt;</b></h2>
                                        <p data-pid="KAtXK-EM">由(7)式计算 <span class="ztext-math" data-eeimg="1"
                                                data-tex="\alpha_1^{new}">\alpha_1^{new}</span> ：</p>
                                        <p data-pid="wgquQPKR"><span class="ztext-math" data-eeimg="1"
                                                data-tex="\alpha_1^{new} = \alpha_1^{old}+y_1y_2\left( \alpha_2^{old}-\alpha_2^{new} \right)\\">\alpha_1^{new}
                                                = \alpha_1^{old}+y_1y_2\left( \alpha_2^{old}-\alpha_2^{new}
                                                \right)\\</span> </p>
                                        <p data-pid="pfEsSEG1">以上3步通过解析方法得到了两个变量的QP子问题的最优解 <span class="ztext-math"
                                                data-eeimg="1" data-tex="\alpha_1^{new}, \alpha_2^{new}">\alpha_1^{new},
                                                \alpha_2^{new}</span> ，相对于数值优化方法，节省了计算时间。本次优化将 <span class="ztext-math"
                                                data-eeimg="1" data-tex="\alpha_1^{old}, \alpha_2^{old}">\alpha_1^{old},
                                                \alpha_2^{old}</span> 更新为 <span class="ztext-math" data-eeimg="1"
                                                data-tex="\alpha_1^{new}, \alpha_2^{new}">\alpha_1^{new},
                                                \alpha_2^{new}</span> 。</p>
                                        <h2>10.4 选择优化变量的启发式方法(Heuristics)</h2>
                                        <p data-pid="hCJ_F2ZV">
                                            SMO在每一步都是选择两个变量进行优化，其中至少有一个违反KKT条件；根据Osuna的理论，每一步优化都会使目标函数值减小，因此可以保证算法的收敛性。
                                        </p>
                                        <p data-pid="UfhRj09b">为加速收敛，SMO采用启发式的方法来选择每一步中优化的两个变量。有两个启发式规则：</p>
                                        <ul>
                                            <li data-pid="88p1MWpB">一个是选择第一个变量的规则，构成外层循环；</li>
                                            <li data-pid="j0MSMdPh">另一个是选择第二个变量的规则，构成内层循环。</li>
                                        </ul>
                                        <h2><b>&lt;1. 选择第一个优化变量(外层循环)&gt;</b></h2>
                                        <p data-pid="mAshyjTD">(1)先遍历整个训练集，违反KKT条件的样本可作为第一个优化变量；</p>
                                        <p data-pid="wdU7P6zR">(2)在遍历整个训练集一次后，遍历那些既不为0也不为 <span class="ztext-math"
                                                data-eeimg="1" data-tex="C">C</span> 的变量(即 <span class="ztext-math"
                                                data-eeimg="1" data-tex="0&lt;\alpha_i&lt;C">0&lt;\alpha_i&lt;C</span>
                                            的样本，称为non-bound样本)，同样，违反KKT条件的可作为第一个优化变量；</p>
                                        <p data-pid="qEQCMEQF">
                                            反复遍历这些non-bound的样本(并优化)，直到所有non-bound样本(即non-bound子集)都满足KKT条件。</p>
                                        <p data-pid="tOkWb8UE">(3)不断交替重复(1)和(2)：遍历整个训练集一次，然后遍历non-bound子集多次，交替进行；</p>
                                        <p data-pid="y6Wl-cwG">(4)直到整个训练集的样本都满足KKT条件 <span class="ztext-math"
                                                data-eeimg="1" data-tex="\left( \rm II \right)">\left( \rm II
                                                \right)</span> ，算法终止。</p>
                                        <p data-pid="yspEi6EY">从两变量QP子问题的解析求解过程可知，</p>
                                        <ul>
                                            <li data-pid="hkLHl-A_">停机条件 <span class="ztext-math" data-eeimg="1"
                                                    data-tex="\left( \rm III \right)">\left( \rm III \right)</span> 中的
                                                <span class="ztext-math" data-eeimg="1"
                                                    data-tex="\left( i \right)">\left( i \right)</span> 是通过对 <span
                                                    class="ztext-math" data-eeimg="1"
                                                    data-tex="\alpha_2^{unclipped}">\alpha_2^{unclipped}</span> 的修剪来满足的；
                                            </li>
                                            <li data-pid="Mvrm2GRi">如果对 <span class="ztext-math" data-eeimg="1"
                                                    data-tex="\alpha">\alpha</span> 初始化的时候满足条件 <span class="ztext-math"
                                                    data-eeimg="1" data-tex="(ii)">(ii)</span> ，那么接下来的每一步优化都会满足条件 <span
                                                    class="ztext-math" data-eeimg="1" data-tex="(ii)">(ii)</span> ；</li>
                                            <li data-pid="bFbkKOST">所以，只需将KKT条件 <span class="ztext-math" data-eeimg="1"
                                                    data-tex="\left( iii \right)">\left( iii \right)</span> 作为停机条件即可。
                                            </li>
                                        </ul>
                                        <p data-pid="BZiEfC0E">检验样本是否满足KKT条件，是在精度 <span class="ztext-math"
                                                data-eeimg="1" data-tex="\varepsilon">\varepsilon</span>
                                            内进行的。精度太高时收敛会慢，一般可将 <span class="ztext-math" data-eeimg="1"
                                                data-tex="\varepsilon">\varepsilon</span> 设置为 <span class="ztext-math"
                                                data-eeimg="1" data-tex="10^{-3}">10^{-3}</span> 到 <span
                                                class="ztext-math" data-eeimg="1" data-tex="10^{-2}">10^{-2}</span>
                                            (Platt1999)。</p>
                                        <p data-pid="IvK3Fmx1">
                                            这个启发式规则把计算时间主要花在最可能违反KKT条件的样本——non-bound子集上。在迭代过程中，边界上的样本( <span
                                                class="ztext-math" data-eeimg="1"
                                                data-tex="\alpha_i\in \left\{ 0,C \right\}">\alpha_i\in \left\{ 0,C
                                                \right\}</span>
                                            ，bound样本)可能继续留在边界上，而non-bound样本会随着其他样本的优化而移动。在优化non-bound子集的时候，可能会导致bound样本违反KKT条件：一方面因为
                                            <span class="ztext-math" data-eeimg="1" data-tex="d_i">d_i</span>
                                            在不断更新，另一方面也因为bound样本可能被选为第二个优化变量，所以需要不断在(1)和(2)之间交替进行优化。</p>
                                        <h2><b>&lt;在精度 <span class="ztext-math" data-eeimg="1"
                                                    data-tex="\varepsilon">\varepsilon</span> 内检查KKT条件的方法&gt;</b></h2>
                                        <p data-pid="frT_B6pB">采用在精度 <span class="ztext-math" data-eeimg="1"
                                                data-tex="\varepsilon">\varepsilon</span>
                                            内检查KKT条件，一方面的原因是可以放宽精度的要求，加快收敛；另一方面的原因是浮点运算存在舍入误差(个人理解)。</p>
                                        <p data-pid="AqoZtMSx">关于在精度 <span class="ztext-math" data-eeimg="1"
                                                data-tex="\varepsilon">\varepsilon</span>
                                            内检查KKT条件的具体做法，文献[1-4]均没有具体描述。<b>但是Platt1998和1999给出了SMO的伪代码(pseudo-code)，从其&#39;主程序&#39;和examineExample()函数可以知道其检查KKT条件所使用的语句。下面进行推导。</b>
                                        </p>
                                        <p data-pid="jMdBPr6A">将条件 <span class="ztext-math" data-eeimg="1"
                                                data-tex="\left( \rm II \right)">\left( \rm II \right)</span> 调整为在精度
                                            <span class="ztext-math" data-eeimg="1"
                                                data-tex="\varepsilon">\varepsilon</span> 内检查：</p>
                                        <p data-pid="3BN-D6HC"><span class="ztext-math" data-eeimg="1"
                                                data-tex="\begin{align} \alpha_i = 0 \ &amp;\Rightarrow \ &amp; &amp;y_id_i\geq 1-\varepsilon\\ 0&lt; \alpha_i &lt; C \ &amp;\Rightarrow \ &amp;1-\varepsilon\leq \ &amp;y_id_i \leq 1+\varepsilon\\ \alpha_i = C \ &amp;\Rightarrow \ &amp; &amp;y_id_i \leq 1+\varepsilon\\ \end{align}\\  \tag{10}">\begin{align}
                                                \alpha_i = 0 \ &amp;\Rightarrow \ &amp; &amp;y_id_i\geq 1-\varepsilon\\
                                                0&lt; \alpha_i &lt; C \ &amp;\Rightarrow \ &amp;1-\varepsilon\leq \
                                                &amp;y_id_i \leq 1+\varepsilon\\ \alpha_i = C \ &amp;\Rightarrow \ &amp;
                                                &amp;y_id_i \leq 1+\varepsilon\\ \end{align}\\ \tag{10}</span> </p>
                                        <p data-pid="X24kiFQu">因为 <span class="ztext-math" data-eeimg="1"
                                                data-tex="y_id_i-1=y_i(d_i-y_i)=y_iE_i">y_id_i-1=y_i(d_i-y_i)=y_iE_i</span>
                                            ，进一步得到</p>
                                        <p data-pid="ikt3YTph"><span class="ztext-math" data-eeimg="1"
                                                data-tex="\begin{align} \alpha_i = 0 \ &amp;\Rightarrow \ &amp; &amp;y_id_i-1\geq -\varepsilon &amp; &amp;\Leftrightarrow \ \ \ \ \ \ \ \ \ \ \ y_iE_i\geq -\varepsilon\\  0&lt; \alpha_i &lt; C \ &amp;\Rightarrow \ &amp;-\varepsilon\leq \ &amp;y_id_i-1 \leq \varepsilon &amp; &amp;\Leftrightarrow -\varepsilon\leq \ y_iE_i \leq \varepsilon\\  \alpha_i = C \ &amp; \Rightarrow \ &amp; &amp;y_id_i-1 \leq \varepsilon &amp; &amp;\Leftrightarrow \ \ \ \ \ \ \ \ \ \ \  y_iE_i\leq \varepsilon\\ \end{align}\\ \tag{11}">\begin{align}
                                                \alpha_i = 0 \ &amp;\Rightarrow \ &amp; &amp;y_id_i-1\geq -\varepsilon
                                                &amp; &amp;\Leftrightarrow \ \ \ \ \ \ \ \ \ \ \ y_iE_i\geq
                                                -\varepsilon\\ 0&lt; \alpha_i &lt; C \ &amp;\Rightarrow \
                                                &amp;-\varepsilon\leq \ &amp;y_id_i-1 \leq \varepsilon &amp;
                                                &amp;\Leftrightarrow -\varepsilon\leq \ y_iE_i \leq \varepsilon\\
                                                \alpha_i = C \ &amp; \Rightarrow \ &amp; &amp;y_id_i-1 \leq \varepsilon
                                                &amp; &amp;\Leftrightarrow \ \ \ \ \ \ \ \ \ \ \ y_iE_i\leq
                                                \varepsilon\\ \end{align}\\ \tag{11}</span> </p>
                                        <p data-pid="KSkqhRqb">将(11)中的条件进行合并，可进一步简化为</p>
                                        <p data-pid="p7TBGrNG"><span class="ztext-math" data-eeimg="1"
                                                data-tex="\left( \alpha_i &lt; C \ \Rightarrow \ y_iE_i\geq -\varepsilon \right) \quad and \quad \left( \alpha_i &gt;0 \Rightarrow \ y_iE_i\leq \varepsilon \right)\\ \tag{12}">\left(
                                                \alpha_i &lt; C \ \Rightarrow \ y_iE_i\geq -\varepsilon \right) \quad
                                                and \quad \left( \alpha_i &gt;0 \Rightarrow \ y_iE_i\leq \varepsilon
                                                \right)\\ \tag{12}</span> </p>
                                        <p data-pid="U7-5-2_6"><b>相反，对违反KKT条件的样本有：</b></p>
                                        <p data-pid="J3C6m2ue"><span class="ztext-math" data-eeimg="1"
                                                data-tex="{\bf violators:} \quad \left( \alpha_i &lt; C \Rightarrow \ y_iE_i&lt; -\varepsilon \right) \quad  or \quad \left( \alpha_i &gt;0 \ \Rightarrow \ y_iE_i&gt; \varepsilon \right)\\ \tag{13} ">{\bf
                                                violators:} \quad \left( \alpha_i &lt; C \Rightarrow \ y_iE_i&lt;
                                                -\varepsilon \right) \quad or \quad \left( \alpha_i &gt;0 \ \Rightarrow
                                                \ y_iE_i&gt; \varepsilon \right)\\ \tag{13} </span> </p>
                                        <p data-pid="A7FogIpE">(13)式就是Platt给出的伪代码中examineExample()函数的判断语句：</p>
                                        <p data-pid="00Vp9klW"><span class="ztext-math" data-eeimg="1"
                                                data-tex="{\bf if} \ (\left( r2 &lt; -tol \ \&amp; \&amp; \ alph2 &lt; C\right) \ \vert \vert \ \left( r2&gt;tol \ \&amp; \&amp; \  alph2&gt;0\right))\\">{\bf
                                                if} \ (\left( r2 &lt; -tol \ \&amp; \&amp; \ alph2 &lt; C\right) \ \vert
                                                \vert \ \left( r2&gt;tol \ \&amp; \&amp; \ alph2&gt;0\right))\\</span>
                                        </p>
                                        <p data-pid="g0lCErBw">
                                            个人认为，从逻辑上讲，用(10)或(11)来检查KKT条件都可行(且更好理解)；但是从编程的角度考虑，(12)或(13)更为简洁。</p>
                                        <p data-pid="YtB0NPz7">此外，在Platt1999伪代码的takeStep()函数中，还有语句</p>
                                        <p data-pid="JRb3k6A7"><span class="ztext-math" data-eeimg="1"
                                                data-tex="\begin{align} &amp;{\bf if} \ (a2&lt;1e-8) \\ &amp; \ \ \ \ a2=0 \\&amp;{\bf else \ if} \ (a2&gt;C-1e-8)\\ &amp; \ \ \ \ a2=C \end{align}\\">\begin{align}
                                                &amp;{\bf if} \ (a2&lt;1e-8) \\ &amp; \ \ \ \ a2=0 \\&amp;{\bf else \
                                                if} \ (a2&gt;C-1e-8)\\ &amp; \ \ \ \ a2=C \end{align}\\</span> </p>
                                        <p data-pid="47nf2gu2">也就是说，当 <span class="ztext-math" data-eeimg="1"
                                                data-tex="\alpha_2&lt;10^{-8}">\alpha_2&lt;10^{-8}</span> 时就将其置为0；当
                                            <span class="ztext-math" data-eeimg="1"
                                                data-tex="\alpha_2&gt;C-10^{-8}">\alpha_2&gt;C-10^{-8}</span> 时就将其置为
                                            <span class="ztext-math" data-eeimg="1" data-tex="C">C</span> 。</p>
                                        <h2><b>&lt;2. 选择第二个优化变量(内层循环)&gt;</b></h2>
                                        <p data-pid="n_zPCaSu">在选定第一个需要优化的变量 <span class="ztext-math" data-eeimg="1"
                                                data-tex="\alpha_1">\alpha_1</span> 后，现在来选择第二个需要优化的变量 <span
                                                class="ztext-math" data-eeimg="1" data-tex="\alpha_2">\alpha_2</span> 。
                                        </p>
                                        <p data-pid="IMboQTsa">选择 <span class="ztext-math" data-eeimg="1"
                                                data-tex="\alpha_2">\alpha_2</span> 的启发式规则是选择样本 <span class="ztext-math"
                                                data-eeimg="1" data-tex="\left( \mathbf x_2, y_2 \right)">\left( \mathbf
                                                x_2, y_2 \right)</span> 来使优化的步长最大化，那么也就是使(6)式中 <span class="ztext-math"
                                                data-eeimg="1"
                                                data-tex="\frac{y_2\left(E_1-E_2\right)}{\eta}">\frac{y_2\left(E_1-E_2\right)}{\eta}</span>
                                            的绝对值最大化。但是计算核函数会耗时间(Platt1998, 1999)，所以SMO采用一种更简单的处理：用 <span
                                                class="ztext-math" data-eeimg="1" data-tex="\vert E_1-E_2\vert">\vert
                                                E_1-E_2\vert</span> 来近似步长。也就是说，选择样本 <span class="ztext-math"
                                                data-eeimg="1" data-tex="\left( \mathbf x_2, y_2 \right)">\left( \mathbf
                                                x_2, y_2 \right)</span> 使 <span class="ztext-math" data-eeimg="1"
                                                data-tex="\vert E_1-E_2\vert">\vert E_1-E_2\vert</span>
                                            最大化。后文会提到，SMO会保存non-bound样本的差值以便查找。</p>
                                        <p data-pid="NRETpqaa">根据Platt1998, 1999，如果 <span class="ztext-math"
                                                data-eeimg="1" data-tex="E_1">E_1</span> 为正，则SMO选择差值 <span
                                                class="ztext-math" data-eeimg="1" data-tex="E_i">E_i</span> 最小的样本 <span
                                                class="ztext-math" data-eeimg="1"
                                                data-tex="\left( \mathbf x_i, y_i \right)">\left( \mathbf x_i, y_i
                                                \right)</span> ；如果 <span class="ztext-math" data-eeimg="1"
                                                data-tex="E_1">E_1</span> 为负，则SMO选择差值 <span class="ztext-math"
                                                data-eeimg="1" data-tex="E_i">E_i</span> 最大的样本 <span class="ztext-math"
                                                data-eeimg="1" data-tex="\left( \mathbf x_i, y_i \right)">\left( \mathbf
                                                x_i, y_i \right)</span> 。</p>
                                        <p data-pid="yINCw661">[注：这里可能看上去不太准确，但实际上是默认了存在与 <span class="ztext-math"
                                                data-eeimg="1" data-tex="E_1">E_1</span> 异号的 <span class="ztext-math"
                                                data-eeimg="1" data-tex="E_2">E_2</span> 。]</p>
                                        <p data-pid="e47kn9Fv">少数情况下可能无法得到正的步长(比如 <span class="ztext-math"
                                                data-eeimg="1" data-tex="\mathbf x_1=\mathbf x_2">\mathbf x_1=\mathbf
                                                x_2</span> 时 <span class="ztext-math" data-eeimg="1"
                                                data-tex="\eta=0">\eta=0</span> )，此时的处理方法是：</p>
                                        <p data-pid="bOUiK5Mu">(a)随机选择起点遍历non-bound子集，寻找能产生正步长的样本作为第二个优化的样本；</p>
                                        <p data-pid="6aJCUE5G">(b)如果(a)仍得不到正步长，那么随机选择起点遍历整个训练集，寻找能产生正步长的样本作为第二个优化的样本；
                                        </p>
                                        <p data-pid="K3XYYpr4">* 这里随机选择起点是为了不让算法偏向于(bias)训练集前面的样本。</p>
                                        <p data-pid="ojO-63_8">
                                            (c)在极端退化的情况下，(a)(b)都得不到正步长，那么就跳过选定的第一个优化变量，重新选择第一个优化变量，算法继续。</p>
                                        <p data-pid="42DS5TUq"><b>至此，我们推导了变量</b> <span class="ztext-math" data-eeimg="1"
                                                data-tex="\alpha">\alpha</span>
                                            <b>的优化，但是每一步优化子问题得到的两个变量未必满足KKT条件，因为到现在为止，我们只是将KKT条件用于选择优化变量。关于使样本满足KKT条件涉及到阈值</b>
                                            <span class="ztext-math" data-eeimg="1" data-tex="b">b</span> <b>的更新。</b>
                                        </p>
                                        <h2><b>后文将继续推导阈值 <span class="ztext-math" data-eeimg="1" data-tex="b">b</span>
                                                和差值 <span class="ztext-math" data-eeimg="1" data-tex="E_i">E_i</span>
                                                的更新。</b></h2>
                                        <h2>To be continued...</h2>
                                        <h2>参考文献</h2>
                                        <p data-pid="45iIb7dA">[1] John C. Platt. Sequential minimal optimization: A
                                            fast algorithm for training support vector machines. Technical Report
                                            MSR-TR-98-14, Microsoft Research, 1998. </p>
                                        <p data-pid="mEQoU815">[2] John C. Platt. Fast training of support vector
                                            machines using sequential minimal optimization. In Advances in Kernel
                                            Methods - Support Vector Learning. B. Scholkopf, C. J. C. Burges, and A. J.
                                            Smola, Eds. MIT Press, Cambridge, MA, 1999: 185-208. </p>
                                        <p data-pid="Bv-bZKRq">[3] 李航，统计学习方法，清华大学出版社，北京，2012年。第7章。</p>
                                        <p data-pid="N-g8sjDP">[4] 邓乃扬，田英杰，数据挖掘中的新方法——支持向量机，科学出版社，北京，2004年。</p>
                                        <p data-pid="cTn9Xpl4">[5] Osuna, E., Freund, R., Girosi, F., An improved
                                            training algorithm for support vector machines. Proc. IEEE NNSP ’97, 1997.
                                        </p>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div role="button" tabindex="0" class="ContentItem-time">编辑于 2019-05-31 04:11</div>
                        <div class="Post-topicsAndReviewer">
                            <div class="TopicList Post-Topics">
                                <style data-emotion-css="1s3a4zw">
                                    .css-1s3a4zw {
                                        position: relative;
                                        display: inline-block;
                                        height: 30px;
                                        padding: 0 12px;
                                        font-size: 14px;
                                        line-height: 30px;
                                        color: #056DE8;
                                        vertical-align: top;
                                        border-radius: 100px;
                                        background: rgba(5, 109, 232, 0.1);
                                    }

                                    .css-1s3a4zw:hover {
                                        background-color: rgba(5, 109, 232, 0.15);
                                    }
                                </style>
                                <div class="Tag Topic css-1s3a4zw"><span class="Tag-content"><a class="TopicLink"
                                            href="//www.zhihu.com/topic/19559450" target="_blank">
                                            <style data-emotion-css="1xlfegr">
                                                .css-1xlfegr {
                                                    background: transparent;
                                                    box-shadow: none;
                                                }
                                            </style>
                                            <style data-emotion-css="1gomreu">
                                                .css-1gomreu {
                                                    position: relative;
                                                    display: inline-block;
                                                }
                                            </style>
                                            <div class="css-1gomreu">机器学习</div>
                                        </a></span></div>
                                <div class="Tag Topic css-1s3a4zw"><span class="Tag-content"><a class="TopicLink"
                                            href="//www.zhihu.com/topic/19583524" target="_blank">
                                            <div class="css-1gomreu">SVM</div>
                                        </a></span></div>
                                <div class="Tag Topic css-1s3a4zw"><span class="Tag-content"><a class="TopicLink"
                                            href="//www.zhihu.com/topic/20687611" target="_blank">
                                            <div class="css-1gomreu">凸二次规划</div>
                                        </a></span></div>
                            </div>
                        </div>
                        <div>
                            <div class="Sticky RichContent-actions is-bottom">
                                <div class="ContentItem-actions"><span><button aria-label="赞同 60 " aria-live="polite"
                                            type="button" class="Button VoteButton VoteButton--up"><span
                                                style="display:inline-flex;align-items:center">​<svg width="10"
                                                    height="10" viewBox="0 0 24 24"
                                                    class="Zi Zi--TriangleUp VoteButton-TriangleUp" fill="currentColor">
                                                    <path fill-rule="evenodd"
                                                        d="M13.792 3.681c-.781-1.406-2.803-1.406-3.584 0l-7.79 14.023c-.76 1.367.228 3.046 1.791 3.046h15.582c1.563 0 2.55-1.68 1.791-3.046l-7.79-14.023Z"
                                                        clip-rule="evenodd"></path>
                                                </svg></span>赞同 60</button><button aria-label="反对" aria-live="polite"
                                            type="button" class="Button VoteButton VoteButton--down"><span
                                                style="display:inline-flex;align-items:center">​<svg width="10"
                                                    height="10" viewBox="0 0 24 24" class="Zi Zi--TriangleDown"
                                                    fill="currentColor">
                                                    <path fill-rule="evenodd"
                                                        d="M13.792 20.319c-.781 1.406-2.803 1.406-3.584 0L2.418 6.296c-.76-1.367.228-3.046 1.791-3.046h15.582c1.563 0 2.55 1.68 1.791 3.046l-7.79 14.023Z"
                                                        clip-rule="evenodd"></path>
                                                </svg></span></button></span><button type="button"
                                        class="Button BottomActions-CommentBtn Button--plain Button--withIcon Button--withLabel"><span
                                            style="display:inline-flex;align-items:center">​<svg width="1.2em"
                                                height="1.2em" viewBox="0 0 24 24" class="Zi Zi--Comment Button-zi"
                                                fill="currentColor">
                                                <path fill-rule="evenodd"
                                                    d="M12 2.75a9.25 9.25 0 1 0 4.737 17.197l2.643.817a1 1 0 0 0 1.25-1.25l-.8-2.588A9.25 9.25 0 0 0 12 2.75Z"
                                                    clip-rule="evenodd"></path>
                                            </svg></span>14 条评论</button>
                                    <div class="Popover ShareMenu">
                                        <div class="ShareMenu-toggler" id="null-toggle" aria-haspopup="true"
                                            aria-expanded="false" aria-owns="null-content"><button type="button"
                                                class="Button Button--plain Button--withIcon Button--withLabel"><span
                                                    style="display:inline-flex;align-items:center">​<svg width="1.2em"
                                                        height="1.2em" viewBox="0 0 24 24"
                                                        class="Zi Zi--Share Button-zi" fill="currentColor">
                                                        <path
                                                            d="M19.47 1.914a.8.8 0 0 1 1.204.778l-1.872 16.386a.9.9 0 0 1-1.204.743l-4.615-1.692a.7.7 0 0 0-.831.28l-1.927 3.02c-.43.674-1.474.369-1.474-.43v-3.865a.8.8 0 0 1 .179-.504l5.808-7.148a.595.595 0 0 0-.897-.781l-5.93 6.354a1.1 1.1 0 0 1-1.258.252L2.57 13.46a.8.8 0 0 1-.08-1.415l16.98-10.13Z">
                                                        </path>
                                                    </svg></span>分享</button></div>
                                    </div><button aria-live="polite" type="button"
                                        class="Button ContentItem-action Button--plain Button--withIcon Button--withLabel"><span
                                            style="display:inline-flex;align-items:center">​<svg width="1.2em"
                                                height="1.2em" viewBox="0 0 24 24" class="Zi Zi--Heart Button-zi"
                                                fill="currentColor">
                                                <path fill-rule="evenodd"
                                                    d="M12.004 4.934c1.015-.944 2.484-1.618 3.98-1.618 3.48 0 6.53 3.265 6.15 7.614-.11 1.254-.686 2.55-1.458 3.753-.778 1.215-1.79 2.392-2.845 3.419-1.054 1.028-2.168 1.923-3.161 2.566a9.96 9.96 0 0 1-1.41.777c-.418.182-.862.32-1.268.32s-.848-.137-1.267-.317a9.918 9.918 0 0 1-1.407-.771c-.992-.64-2.103-1.53-3.156-2.555-1.052-1.024-2.062-2.2-2.84-3.417-.77-1.208-1.346-2.51-1.456-3.775-.38-4.349 2.67-7.614 6.15-7.614 1.484 0 2.983.673 3.988 1.618Z"
                                                    clip-rule="evenodd"></path>
                                            </svg></span>喜欢</button><button type="button"
                                        class="Button Button--plain Button--withIcon Button--withLabel"><span
                                            style="display:inline-flex;align-items:center">​<svg width="1.2em"
                                                height="1.2em" viewBox="0 0 24 24" class="Zi Zi--Star Button-zi"
                                                fill="currentColor">
                                                <path
                                                    d="M10.484 3.307c.673-1.168 2.358-1.168 3.032 0l2.377 4.122a.25.25 0 0 0 .165.12l4.655.987c1.319.28 1.84 1.882.937 2.884l-3.186 3.535a.25.25 0 0 0-.063.193l.5 4.733c.142 1.34-1.222 2.33-2.453 1.782l-4.346-1.938a.25.25 0 0 0-.204 0l-4.346 1.938c-1.231.549-2.595-.442-2.453-1.782l.5-4.733a.25.25 0 0 0-.064-.193L2.35 11.42c-.903-1.002-.382-2.604.937-2.884l4.655-.987a.25.25 0 0 0 .164-.12l2.378-4.122Z">
                                                </path>
                                            </svg></span>收藏</button><button type="button"
                                        class="Button ContentItem-action Button--plain Button--withIcon Button--withLabel"><span
                                            style="display:inline-flex;align-items:center">​<svg width="1.2em"
                                                height="1.2em" viewBox="0 0 24 24" class="Zi Zi--Deliver Button-zi"
                                                fill="currentColor">
                                                <g fill-rule="evenodd" clip-rule="evenodd">
                                                    <path
                                                        d="M7.821 12a.75.75 0 0 1 .75-.75h6.857a.75.75 0 0 1 0 1.5H8.571a.75.75 0 0 1-.75-.75ZM8.965 8a.75.75 0 0 1 .75-.75h4.571a.75.75 0 0 1 0 1.5H9.715a.75.75 0 0 1-.75-.75Z">
                                                    </path>
                                                    <path
                                                        d="M7.527 3.15a2.35 2.35 0 0 0-2.309 1.91L3.165 15.84a.85.85 0 0 0-.015.16v2.5a2.35 2.35 0 0 0 2.35 2.35h13a2.35 2.35 0 0 0 2.35-2.35V16a.848.848 0 0 0-.015-.16L18.78 5.06a2.35 2.35 0 0 0-2.308-1.91H7.527Zm0 1.7a.65.65 0 0 0-.639.528l-1.88 9.872h13.984l-1.88-9.872a.65.65 0 0 0-.64-.528H7.528Z">
                                                    </path>
                                                </g>
                                            </svg></span>申请转载</button>
                                    <div class="Post-ActionMenuButton">
                                        <div class="Popover">
                                            <div id="null-toggle" aria-haspopup="true" aria-expanded="false"
                                                aria-owns="null-content"><button type="button"
                                                    class="Button Button--plain Button--withIcon Button--iconOnly undefined"><span
                                                        style="display:inline-flex;align-items:center">​<svg
                                                            width="1.2em" height="1.2em" viewBox="0 0 24 24"
                                                            class="Zi Zi--Dots Button-zi" fill="currentColor">
                                                            <path fill-rule="evenodd"
                                                                d="M5.83 12a1.665 1.665 0 1 1-3.33 0 1.665 1.665 0 0 1 3.33 0Zm7.835 0a1.665 1.665 0 1 1-3.33 0 1.665 1.665 0 0 1 3.33 0Zm6.17 1.665a1.665 1.665 0 1 0 0-3.33 1.665 1.665 0 0 0 0 3.33Z"
                                                                clip-rule="evenodd"></path>
                                                        </svg></span></button></div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </article>
                    <div class="Post-Sub Post-NormalSub">
                        <div class="PostIndex-Contributions">
                            <h3 class="BlockTitle">文章被以下专栏收录</h3>
                            <ul>
                                <div class="ContentItem Column-ColumnItem">
                                    <div class="ContentItem-main">
                                        <div class="ContentItem-image"><a class="ColumnLink"
                                                href="//www.zhihu.com/column/c_1091644779288514560">
                                                <div class="css-1gomreu">
                                                    <style data-emotion-css="1any501">
                                                        .css-1any501 {
                                                            box-sizing: border-box;
                                                            margin: 0;
                                                            min-width: 0;
                                                            max-width: 100%;
                                                            height: auto;
                                                            background-color: #FFFFFF;
                                                            width: 40px;
                                                            height: 40px;
                                                            border-radius: 50%;
                                                        }
                                                    </style><img class="Avatar css-1any501"
                                                        src="https://pic1.zhimg.com/v2-026004097eae3217438938cbe68f9ed5_l.jpg?source=172ae18b"
                                                        srcSet="https://pic1.zhimg.com/v2-026004097eae3217438938cbe68f9ed5_l.jpg?source=172ae18b 2x"
                                                        alt="几种机器学习算法的原理&amp;sklearn" />
                                                </div>
                                            </a></div>
                                        <div class="ContentItem-head">
                                            <h2 class="ContentItem-title"><span><a class="ColumnLink ColumnItem-Title"
                                                        href="//www.zhihu.com/column/c_1091644779288514560">
                                                        <div class="css-1gomreu">几种机器学习算法的原理&amp;sklearn</div>
                                                    </a></span></h2>
                                            <div class="ContentItem-meta">学习笔记，硬核</div>
                                        </div>
                                    </div>
                                </div>
                            </ul>
                        </div>
                    </div>
                </div>
            </main>
        </div>
    </div>
</body>


</html>